Oh, I found it. You use last instead of break
for my $entry (@array){
if ($string eq "text"){
last;
}
}
More Related Contents:
- Failing to install MIME::Base64 using cpan [closed]
- Declaring a 2D coordinate in Perl / C / C++ [closed]
- Why can’t Perl find my file that is in ClearCase?
- Is using a ‘goto’ statement bad?
- Difference of Two Arrays Using Perl
- How can I output UTF-8 from Perl?
- What’s the difference between my ($variableName) and my $variableName in Perl?
- What’s the difference between a hash and hash reference in Perl?
- Multiline search replace with Perl
- How do I “use” a Perl module in a directory not in @INC?
- How can I process options using Perl in -n or -p mode?
- How can I dynamically include Perl modules without using eval?
- How can I compile my Perl script so it can be executed on systems without ‘perl’ installed?
- What is the difference between my and local in Perl?
- How can I guess the encoding of a string in Perl?
- How to break out of a loop from inside a switch?
- Perl read line by line
- Using output from a previous job in a new one in a GitHub Action
- What does !! (double exclamation point) mean?
- Using my with parentheses and only one variable
- Do you use an exception class in your Perl programs? Why or why not?
- What does shift() do in Perl?
- Local and Global variables in perl
- What do you get if you evaluate a hash in scalar context?
- How to read to and write from a pipe in Perl?
- Can a Perl script install its own CPAN dependencies?
- How to make DateTime::Duration output only in days?
- In Perl, is it appropriate to use map in void context instead of a foreach loop?
- How do I tell CPAN to install all dependencies?
- How does a Perl program know where to find the file containing Perl module it uses?