On 6 July 2014 02:31, Sunita Pradhan
wrote:
> I have a set of code for count number of lines and number of words .
>
> #!/usr/bin/perl
>
> while ($line = ){
> chomp ($line);
> $hash{L_c_start}++ if ($line =~ /^C.*/i);
> @words = split /\s+/,$line;
> *foreach $c (k
I have a set of code for count number of lines and number of words .
#!/usr/bin/perl
while ($line = ){
chomp ($line);
$hash{L_c_start}++ if ($line =~ /^C.*/i);
@words = split /\s+/,$line;
foreach $c (keys @words){
print "word $words[$c]\n";
On 27/05/2013 23:55, shawn wilson wrote:
On May 27, 2013 1:02 PM, "Dr.Ruud" mailto:rvtol%2buse...@isolution.nl>> wrote:
> On 26/05/2013 14:40, shawn wilson wrote:
>> Thank y'all, I got to where I want to be:
>> https://github.com/ag4ve/geocidr
>
> > ...
> > or grep { ! m%[0-9\.\/]+% } @{
On May 27, 2013 1:02 PM, "Dr.Ruud" wrote:
>
> On 26/05/2013 14:40, shawn wilson wrote:
>
>> Thank y'all, I got to where I want to be:
>> https://github.com/ag4ve/geocidr
>
>
> > ...
> > or grep { ! m%[0-9\.\/]+% } @{$opts->{ip}}
> > or scalar(@{$opts->{ip}}) < 1
>
> The '+' in the regexp is superf
On 26/05/2013 14:40, shawn wilson wrote:
Thank y'all, I got to where I want to be:
https://github.com/ag4ve/geocidr
> ...
> or grep { ! m%[0-9\.\/]+% } @{$opts->{ip}}
> or scalar(@{$opts->{ip}}) < 1
The '+' in the regexp is superfluous as-is.
(your regexp isn't anchored)
You probably meant
Thank y'all, I got to where I want to be:
https://github.com/ag4ve/geocidr
On Sun, May 26, 2013 at 8:06 AM, Michael Rasmussen wrote:
> On Fri, May 24, 2013 at 03:18:35PM -0400, shawn wilson wrote:
>> How do I find the next subnet? This should print 192.168.1.0 the
>> sec
On Fri, May 24, 2013 at 03:18:35PM -0400, shawn wilson wrote:
> How do I find the next subnet? This should print 192.168.1.0 the
> second time - it errors:
[code deleted]
Why should it? The Net::IP documentation doesn't provide any information about
actions that cross the subnet bound
On 24/05/2013 21:18, shawn wilson wrote:
How do I find the next subnet? This should print 192.168.1.0 the
second time - it errors:
#!/usr/bin/env perl
use strict;
use warnings;
use Net::IP;
my $ip = Net::IP->new('192.168.0.0/24');
print "Start ip [" . $ip->ip
How do I find the next subnet? This should print 192.168.1.0 the
second time - it errors:
#!/usr/bin/env perl
use strict;
use warnings;
use Net::IP;
my $ip = Net::IP->new('192.168.0.0/24');
print "Start ip [" . $ip->ip . "]\n";
print "start mask [
On 09/04/2012 14:24, Vyacheslav wrote:
My code
my %attr = (
PrintError => 0,
RaiseError => 0
);
my $dbh = DBI->connect($dsn, $user, $pass, \%attr);
unless ($dbh) {
next;
}
my $query = "SHOW DATABASES";
I use
unless ($dbh) {
next;
} and this work fine.
Thanks
09.04.201
My code
my %attr = (
PrintError => 0,
RaiseError => 0
);
my $dbh = DBI->connect($dsn, $user, $pass, \%attr);
unless ($dbh) {
next;
}
my $query = "SHOW DATABASES";
I use
unless ($dbh) {
next;
} and this work fine.
Thanks
09.04.2012 01:22, Jim Gibson написал:
At 12
At 12:50 AM + 4/9/12, Vyacheslav wrote:
I enabled RaiserError, then script die.
...
my %attr = (
PrintError => 0,
RaiseError => 1
);
Use:
RaiseError => 0
instead so that your script will not raise an exception and die. Then
check $dbh->err.
--
To unsubscribe, e-mail: beginne
I enabled RaiserError, then script die.
...
my %attr = (
PrintError => 0,
RaiseError => 1
);
my $dbh = DBI->connect($dsn, $user, $pass, \%attr); # or die "Can't
connect to the DB: $DBI::errstr\n";
my $query = "SHOW DATABASES";
my $sth = $dbh->prepare($query) or die "Can't prepare SQL st
On 2012-04-08 17:10, Vyacheslav wrote:
using eval helped me.
You should not use exceptions for normal code flow.
Read the DBI docs (perldoc DBI).
If a failed connection must be an exception, set RaiseError to true.
But if it isn't an exception, leave it false, and test $dbh->err (or the
glob
Hi Vyacheslav,
On Sun, 08 Apr 2012 15:10:06 +
Vyacheslav wrote:
> Thanks all.
>
> using eval helped me.
>
The problem with eval in Perl 5 is that it catches any and all thrown exceptions
. I.e: by default, it doesn't do Object-Oriented exceptions like Java, Ruby,
Python and other language
Since this exception is not caught (using eval { ... }) it terminates the
entire program. So what you should do instead is handle it gracefully (say
using "next"):
my $dbh = DBI->connect($dsn, $user, $pass);
if (!$dbh)
{
next DB_HOSTS_LOOP; # And label the loop appropriately.
}
www.socialtext.net/perl5/exception_handling
Since this exception is not caught (using eval { ... }) it terminates the
entire program. So what you should do instead is handle it gracefully (say
using "next"):
my $dbh = DBI->connect($dsn, $user, $pass);
if (!$dbh)
{
"host $db - not ok";
} else {
print "host $db - ok";
}
http://www.gnome.org/friends/banners/associate.png"; alt="Become a
Friend of GNOME" border="0" />
From: Vyacheslav
To: beginners@perl.org
Sent: Sund
st db3 - ok
DBI connect('information_schema:db4:3306','user',...) failed: Can't
connect to MySQL server on 'db4' (111) at ./dbcheck.pl line 53
and script die
How I can pass an error that the cycle has continued execute? I need
host db1 - ok
host db2 - ok
host db3 - o
p($line);
> if ($line =~ /NetBIOS\ name\ :\ <\/td>/){
You don't have to escape =, " and whitespace. If you have "/"s in the string,
you can use a different delimiter:
if ($line =~ m{...})
Also it seems you're looking for a substring. For that you
uot;Report.html") || die "No se puede abrir el archivo:$!";
while($line=){
chomp($line);
if ($line =~ /NetBIOS\ name\ :\ <\/td>/){
print "Name:\t";
print $',"\n";
}
}
close(H)
How do you see I try t
On Aug 12, 2010, at 19:08, Kryten wrote:
> Hi,
>
> Complete newbie.
>
> Is there any way to use "next" from within a foreach loop?
>
> All the examples I have seen/read use a while loop to demo.
Yes, next will work on for/foreach, while, and until loops. So yo
2010/8/13 Kryten :
> Hi,
>
> Complete newbie.
>
> Is there any way to use "next" from within a foreach loop?
>
Sure.
$ perl -le '
> for (1..10) {
> next if $_ == 5;
> print;
> } '
1
2
3
4
6
7
8
9
10
--
Jeff Pang
http://home.arco
Hi,
Complete newbie.
Is there any way to use "next" from within a foreach loop?
All the examples I have seen/read use a while loop to demo.
Thanks,
Stuart
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On Jun 8, 2:18 am, learn.tech...@gmail.com (Amit Saxena) wrote:
> Hi all,
>
> I want to know how to find the status, i.e. "next run time" and "last run
> time", of a task which is run through windows task scheduler.
>
> This is required so as to find o
On Tue, Jun 8, 2010 at 05:18, Amit Saxena wrote:
> Hi all,
>
> I want to know how to find the status, i.e. "next run time" and "last run
> time", of a task which is run through windows task scheduler.
>
> This is required so as to find out instances where a
Hi all,
I want to know how to find the status, i.e. "next run time" and "last run
time", of a task which is run through windows task scheduler.
This is required so as to find out instances where a task gets "hanged"
after run through windows task scheduler.
Thanks & Regards,
Amit Saxena
Date sent: Tue, 06 Oct 2009 15:45:44 +0200
From: Alexander Koenig
To: beginners
Subject:eval and next
> Hi all,
>
> I have a Perl program where I use eval to catch errors. As they are Java
> errors (via Inline::Jav
Hi all,
I have a Perl program where I use eval to catch errors. As they are Java
errors (via Inline::Java) I want my program to continue and just log the
errors somewhere.
My problem with this is, that I use the eval within a loop and I also
use next in this loop to ignore some special cases
On Thu, 2009-01-29 at 14:39 +0800, itshardtogetone wrote:
> Hi,
> How do I copy the first 10 elements of @a into @b?
>
> The method that I use is long :-
> my @a = 1..20;
> my @b = ();
>
> my $ctr = 0;
> foreach (@a){
> if ($ctr < 10){
> push @b,$_;
> }
> $ctr ++;
> }
See
itshardtogetone wrote:
Hi,
Hello,
How do I copy the first 10 elements of @a into @b?
my @b = @a[ 0 .. 9 ];
John
--
Those people who think they know everything are a great
annoyance to those of us who do.-- Isaac Asimov
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For
try this,
@b[0..9] = @a[0..9];
- 原邮件 -
从: itshardtogetone
日期: 星期四, 一月 29日, 2009 下午2:39
主题: how to copy elements into the next array
> Hi,
> How do I copy the first 10 elements of @a into @b?
>
> The method that I use is long :-
> my @a = 1..20;
> my @b = ()
Hi,
How do I copy the first 10 elements of @a into @b?
The method that I use is long :-
my @a = 1..20;
my @b = ();
my $ctr = 0;
foreach (@a){
if ($ctr < 10){
push @b,$_;
}
$ctr ++;
}
Thanks.
[EMAIL PROTECTED] schreef:
> How do I round off a decimal to the next nearest whole digit ,
> example
> 0.123 = 1,
> 1.23 = 2,
> 4.7312 = 5, etc etc.
Define "next".
You can use POSIX::ceil(),
but then -1.23 becomes -1 and you might want -2 there?
$ echo
[EMAIL PROTECTED] wrote:
>
> How do I round off a decimal to the next nearest whole digit ,
> example
> 0.123 = 1,
> 1.23 = 2,
> 4.7312 = 5, etc etc.
>
> Right now I can only do the above by extracting the first digit using splice
> , then add one.
You need t
[EMAIL PROTECTED] 写道:
> Hi,
> How do I round off a decimal to the next nearest whole digit ,
> example
> 0.123 = 1,
> 1.23 = 2,
> 4.7312 = 5, etc etc.
$number = int($number) + 1;
also does the same thing.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comman
On Wed, 2008-08-06 at 13:31 +0800, [EMAIL PROTECTED] wrote:
> Hi,
> How do I round off a decimal to the next nearest whole digit ,
> example
> 0.123 = 1,
> 1.23 = 2,
> 4.7312 = 5, etc etc.
>
> Right now I can only do the above by extracting the first digit using
> -Original Message-
> From: Anirban Adhikary [mailto:[EMAIL PROTECTED]
> Sent: 06 August 2008 06:51
> To: beginners@perl.org
> Subject: Re: how to round off a decimal to the next whole number
>
> On Wed, Aug 6, 2008 at 11:01 AM, <[EMAIL PROTECTED]> wrote:
&g
On Wed, Aug 6, 2008 at 11:01 AM, <[EMAIL PROTECTED]> wrote:
> Hi,
> How do I round off a decimal to the next nearest whole digit ,
> example
> 0.123 = 1,
> 1.23 = 2,
> 4.7312 = 5, etc etc.
>
> Right now I can only do the above by extracting the first digit
Hi,
How do I round off a decimal to the next nearest whole digit ,
example
0.123 = 1,
1.23 = 2,
4.7312 = 5, etc etc.
Right now I can only do the above by extracting the first digit using splice
, then add one.
Thanks
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands
Just posted to clpmisc:
Original Message
Subject: Re: Operator ->()
Date: Thu, 27 Mar 2008 20:35:27 +0100
From: Gunnar Hjalmarsson <[EMAIL PROTECTED]>
Newsgroups: comp.lang.perl.misc
Subra wrote:
[ exactly the same question as was posted to the beginners list a few
minutes ear
From: Subra <[EMAIL PROTECTED]>
> Can some one pls tell me wts the meaning of "$topIter->next()" ?
> I know "->" is used for hash refs, but dont know when to use ->( ) !!!
-> is used for any references. And for method calls. In this case you
are call
Can some one pls tell me wts the meaning of "$topIter->next()" ?
I know "->" is used for hash refs, but dont know when to use ->( ) !!!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Thanks for all your comments.
Jeff Pang wrote, On 11/12/2007 12:26 PM:
On Nov 12, 2007 2:48 PM, Praveena Vittal <[EMAIL PROTECTED]> wrote:
Hi,
Thanks for your comments..
I like to know what does the below represents..
$'
from `perldoc perlvar':
$' The string followin
Praveena Vittal wrote:
I like to know what does the below represents..
$'
Then why don't you look it up in the docs instead of asking hundreds of
people to read the docs for you?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTE
On Nov 12, 2007 2:48 PM, Praveena Vittal <[EMAIL PROTECTED]> wrote:
> Hi,
> Thanks for your comments..
>
> I like to know what does the below represents..
>
> $'
>
from `perldoc perlvar':
$' The string following whatever was matched by the last success-
ful pattern m
Hi,
Thanks for your comments..
I like to know what does the below represents..
$'
Regards,
Praveena
Jeff Pang wrote, On 11/07/2007 06:48 PM:
--- Praveena Vittal <[EMAIL PROTECTED]> wrote:
Hi all,
I like to know how can we read a line next to the current position
--- Praveena Vittal <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I like to know how can we read a line next to the current position in
> a file .
>
Hi,
in scalar context will read next line.ie,
open FD,"file" or die $!;
for (1..3);
# now you're in No
Hi all,
I like to know how can we read a line next to the current position in
a file .
Regards,
Praveena
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On Sep 27, 2007, at 1:29 AM, Mahurshi Akilla wrote:
Is there a way in perl to peek the next line in the file while keeping
the line pointer the same?
I want to do something like this:
while ()
{
//do some stuff
//?? peek next line ?? and enter conditional block//
//do some more
Is there a way in perl to peek the next line in the file while keeping
the line pointer the same?
I want to do something like this:
while ()
{
//do some stuff
//?? peek next line ?? and enter conditional block//
//do some more stuff
}
Of course, there are workarounds, but it
ess on any incoming email received by Request Tracker is
>> automatically turned into a user account. With the amount of spam
>> flying around
>> the the Net these days those user accounts add up.
>>
>> All those spam tickets are assigned to me so I can eliminate them
ess on any incoming email received by Request Tracker is
>> automatically turned into a user account. With the amount of spam
>> flying around
>> the the Net these days those user accounts add up.
>>
>> All those spam tickets are assigned to me so I can eliminate them
ys those user accounts add up.
All those spam tickets are assigned to me so I can eliminate them and the users
created as a result of them from our database. My goal is to parse $data to
pull out all the email addresses which I will then sift through to remove any
legitimate addresses.
You'l
add up.
All those spam tickets are assigned to me so I can eliminate them and the users
created as a result of them from our database. My goal is to parse $data to
pull out all the email addresses which I will then sift through to remove any
legitimate addresses.
You'll notice I declare the u
Dear All,
Thank you so much for sending me the solution to my problem. It was the
first problem I asked and I am really happy I got very well explained
answers. I understood it well.
Thanks again for every one who take time to answer my question.
Kind regards,
Geetha
On Jul 6, 2006, at 6:26, Geetha Weerasooriya wrote:
Dear all,
When I was reading a Perl code I found the following line. Can u
please
explain what it means?
!defined($rt_nearest) or $dh<$dist or next;
It means
next unless !defined($rt_nearest) or $dh < $dist;
or, equiva
basically code done by a hacker, not a software developer
if I'm correct this shall mine
if (not( ! defined($rt_nearest) or $dh<$dist)) {
next;
}
On 7/6/06, Geetha Weerasooriya <[EMAIL PROTECTED]> wrote:
Dear all,
When I was reading a Perl code I found the following line
Geetha Weerasooriya wrote:
>
> Dear all,
>
> When I was reading a Perl code I found the following line. Can u
> please explain what it means?
>
> !defined($rt_nearest) or $dh<$dist or next;
Hi Geetha
Oh dear, it's not very readable is it! I assume you know what
Dear all,
When I was reading a Perl code I found the following line. Can u please
explain what it means?
!defined($rt_nearest) or $dh<$dist or next;
Kind regards,
Geetha
Hi all,
I am writing a code that would check line by line content of a line before
processing it. Problem occurs when there are lines that has character "\"
indicating a new line. For example
preprocessor http_inspect: global \
iis_unicode_map unicode.map 1252
When that happen, my code should
Chris Devers <[EMAIL PROTECTED]> wrote:
: On Thu, 16 Dec 2004, Charles K. Clarkson wrote:
:
: : Don't declare all your variables at the beginning
: : of the script. It works in other languages, but not
: : in perl. Declare them as you go.
:
: Out of curiosity, why this rule?
:
: When taking
On Fri, 17 Dec 2004, Paul Johnson wrote:
> On Fri, Dec 17, 2004 at 09:17:05AM -0500, Chris Devers wrote:
>
> > On Thu, 16 Dec 2004, Charles K. Clarkson wrote:
> >
> > > Don't declare all your variables at the beginning
> > > of the script. It works in other languages, but not
> > > in perl.
Sorry, I sent the last reply before I had finished it.
On Fri, Dec 17, 2004 at 09:17:05AM -0500, Chris Devers wrote:
> On Thu, 16 Dec 2004, Charles K. Clarkson wrote:
>
> > Don't declare all your variables at the beginning
> > of the script. It works in other languages, but not
> > in perl.
> Out of curiosity, why this rule?
>
> When taking programming classes in college, it was drummed into us that
> having a data dictionary at the top of a scope was a good habit, and
> it's something that I've generally done with the Perl I've written.
>
> Several people on this list have disc
On Fri, 17 Dec 2004, Jonathan Paton wrote:
> On Fri, 17 Dec 2004 09:17:05 -0500 (EST), Chris Devers wrote:
>
> And what programming language were you learning?
C/C++, Java, Visual Basic, Cobol.
> In some other languages, like C, C++ and Java you must specify the
> exact type of each variable.
On Fri, Dec 17, 2004 at 09:17:05AM -0500, Chris Devers wrote:
> On Thu, 16 Dec 2004, Charles K. Clarkson wrote:
>
> > Don't declare all your variables at the beginning
> > of the script. It works in other languages, but not
> > in perl. Declare them as you go.
I suppose that depends on your
On Fri, 17 Dec 2004 09:17:05 -0500 (EST), Chris Devers
<[EMAIL PROTECTED]> wrote:
> On Thu, 16 Dec 2004, Charles K. Clarkson wrote:
>
> > Don't declare all your variables at the beginning
> > of the script. It works in other languages, but not
> > in perl. Declare them as you go.
>
> Out of c
On Thu, 16 Dec 2004, Charles K. Clarkson wrote:
> Don't declare all your variables at the beginning
> of the script. It works in other languages, but not
> in perl. Declare them as you go.
Out of curiosity, why this rule?
When taking programming classes in college, it was drummed into us th
you go.
: LOOKING_LINES: while(@line = `cat clicenses_output`){
Stop using line labels. They work in perl, but they
are rarely needed.
[snip]
: This is the line giving me issues:
:
: LOOKING_HANDLES: while (@line = `cat
: clicenses_output`);
:
: Basically, after I grab $feature I need to mo
es;
my $features;
my $sizeof;
my $counter = 0;
my $answer;
my $string;
LOOKING_LINES: while(@line = `cat clicenses_output`){
foreach $line(@line){
next unless $line =~ /\S/;
$line =~ s/^\s+//;
@features_array = split /\s/, $line;#split $line
John;
Thank you very much for the help...works like a charm...now I'll try
to study it carefully to understand how to use this the next time I need
something like this...
Cool...
Ken Wolcott
On Tue, 2004-08-03 at 20:20, John W. Krahn wrote:
> Ken Wolcott wrote:
> > Hi;
>
&g
I am using RH9, postgreSQL and perl5. Is it possible to get users to submit multiple
page web-forms but not to pass values from one form to the next? I would like to store
each page to the database server as it is submitted. Also, to build in the process to
resume the web-form submission at a
Ken Wolcott wrote:
Hi;
Hello,
I need to find Makefiles that contain a backslash line continuation
character followed by a blank (or whitespace only) line. I tried a
regular expression first but just couldn't get it right. I then tried
comparing by a pair of strings, but that isn't right either.
Hi;
I need to find Makefiles that contain a backslash line continuation
character followed by a blank (or whitespace only) line. I tried a
regular expression first but just couldn't get it right. I then tried
comparing by a pair of strings, but that isn't right either.
First try:
On Apr 22, rmck said:
>bash-2.03$ ./clean.pl data.txt
>10
>5201
>8001
>0
>3802
>##The Rest##
>Header
>20
>80
>bash-2.03$
>
>I thought I could do this:
>
>#!/bin/perl
> use strict;
> use warnings;
>
> while( <> ) { #read fr
Both of these work great (thanks):
next if $_ =~ /(^20$|^80$|^Header$)/;
next if m/^(?:Header|[28]0)$/;
So now my results are:
bash-2.03$ ./clean.pl data.txt
10
5201
8001
0
3802
bash-2.03$
How can you have the parsed info printed?
Can you still use the $_??
So the goal would be:
bash-2.03
On Apr 22, 2004, at 8:54 AM, rmck wrote:
hi,
I have a while statement that does a next if a match is made against a
reg exprerssion of some numbers.
data file:
Header
10
20
5201
8001
0
80
3802
#!/bin/perl
use strict;
use warnings;
while( <> ) { #read from
hi,
I have a while statement that does a next if a match is made against a reg exprerssion
of some numbers.
data file:
Header
10
20
5201
8001
0
80
3802
#!/bin/perl
use strict;
use warnings;
while( <> ) { #read from stdin one line or record at a
time
From: Harry Putnam <[EMAIL PROTECTED]>
> I wasn't able to really understand perldoc -f warn.
>
> I'm doing
> use File::Find;
> open(FILE,"<$File::Find::name")or warn "blah blah: $!";
>
> Two things I'm unsure of:
>
> 1) is
Harry Putnam wrote:
> "Charles K. Clarkson" <[EMAIL PROTECTED]> writes:
>
> > HTH,
>
> Definitely and thanks for the examples. I think I was making this
> more complicated that it needed to be. It's slowly sinking in what
> all a `return' can do.
Hi Harry,
Glad Charles got you squared away. I
"Wiggins d'Anconia" <[EMAIL PROTECTED]> writes:
[...]
> if you don't mind dieing, or I often prefer using 'unless' then I
> don't need to worry about a dangling else, so similar to what you have
> above,
In this case I do.
>
> unless (open(FILE, "<$file")) {
>warn "Failed open: $!";
>re
Harry Putnam wrote:
"John W. Krahn" <[EMAIL PROTECTED]> writes:
If so, how do I let the `next' know that open has failed?
That is, how do I test exit status of open function?
open() returns true on success and undef (false) when it fails.
Is it just as
in shell programing
"Charles K. Clarkson" <[EMAIL PROTECTED]> writes:
> HTH,
Definitely and thanks for the examples. I think I was making this
more complicated that it needed to be. It's slowly sinking in what
all a `return' can do.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [E
"John W. Krahn" <[EMAIL PROTECTED]> writes:
>> If so, how do I let the `next' know that open has failed?
>> That is, how do I test exit status of open function?
>
> open() returns true on success and undef (false) when it fails.
>
>
>> Is it jus
Harry Putnam wrote:
>
> I wasn't able to really understand perldoc -f warn.
>
> I'm doing
> use File::Find;
> open(FILE,"<$File::Find::name")or warn "blah blah: $!";
>
> Two things I'm unsure of:
>
> 1) is the `: $!' m
t.. or
: does one need to exit from the current file being offered
: by `sub find()'
:
: > : So using the `next LABEL' technique how do I
: > : designate the wanted() subroutine as target?
: > : Something like this:
: > :
: > : sub LABEL: wanted {
: >
: > I have
fered by `sub find()'
> : So using the `next LABEL' technique how do I
> : designate the wanted() subroutine as target?
> : Something like this:
> :
> : sub LABEL: wanted {
>
> I haven't tested it, but I would think this would fail.
>
> : open(FIL
Harry Putnam <[EMAIL PROTECTED]> wrote:
:
: I'm using a next LABEL inside a File::Find
: sub wanted {...} loop
:
: It is further buried in a while loop inside the
: `sub wanted()'
:
: The while loop is while () on the most recent
: found file. I want this `next LABEL' to
I'm using a next LABEL inside a File::Find
sub wanted {...} loop
It is further buried in a while loop inside the `sub wanted()'
The while loop is while () on the most recent found file. I
want this `next LABEL' to bring on a new file... not a new line in
while loop.
So using
I wasn't able to really understand perldoc -f warn.
I'm doing
use File::Find;
open(FILE,"<$File::Find::name")or warn "blah blah: $!";
Two things I'm unsure of:
1) is the `: $!' meaningfull here?
2) do I need a `next;' following to make `File::Find
Harry Putnam wrote:
I'm getting this output on stderr from a next clause:
Exiting subroutine via next at ./test_bol.pl line 101.
I wondered why this happens. Is it considered an error or what?
The script is lengthy so not posting it here but the next does exit a
sub routine. That is why
"Randy W. Sims" <[EMAIL PROTECTED]> writes:
> Use 'return' to exit from a subroutine. Use 'next', 'redo', 'last',
> and 'goto' to alter the execution path in loop constructs; they must
> appear /inside/ the block owned by
On Sat, Mar 27, 2004 at 03:24:13PM -0500, Randy W. Sims wrote:
> Harry Putnam wrote:
> >I'm getting this output on stderr from a next clause:
> > Exiting subroutine via next at ./test_bol.pl line 101.
> >
> >I wondered why this happens. Is it considered an err
Harry Putnam wrote:
I'm getting this output on stderr from a next clause:
Exiting subroutine via next at ./test_bol.pl line 101.
I wondered why this happens. Is it considered an error or what?
The script is lengthy so not posting it here but the next does exit a
sub routine. That is why
I'm getting this output on stderr from a next clause:
Exiting subroutine via next at ./test_bol.pl line 101.
I wondered why this happens. Is it considered an error or what?
The script is lengthy so not posting it here but the next does exit a
sub routine. That is why I put it there. S
On Sun, Oct 19, 2003 at 08:02:34PM -0700, R. Joseph Newton wrote:
> I think your formatting may reflect a misconception about if and
> elsif staements.
>
> while ($foo) {
> if ($condition_1) {
> do_1();
> }
> elsif ($condition_2) {
> do_2();
> }
> # ...
> }
>
> Should be:
Wait a m
Dan Anderson wrote:
> > But what's the speed concerns here? This is negligable.
>
> I just double checked and each if statement takes roughly 9.8
> microseconds more to execute then an elsif. That may not seem like a
> lot but over a program spanning several files (perhaps as much as a meg
> in
On Wed, 15 Oct 2003 17:34:33 -0400, Dan Anderson wrote:
> How is speed affected in the following scenarios:
> [...]
Why don't you find out? Take a look at the Benchmark module. There is
also a 'SWITCH' module out there, I think. You might look at that one,
too.
--
Tore Aursand <[EMAIL PROTEC
On Wednesday, October 15, 2003, at 07:30 PM, Dan Anderson wrote:
Now this is not actually reflective of the code in my program. I just
needed a clean, controlled environment to compare different things.
Do you have a large if/else decision tree? We might be able to
provides some ideas there if
1 - 100 of 162 matches
Mail list logo