Re: [SLUG] Perl Question

2008-04-02 Thread Rick Welykochy
Rick Welykochy wrote: Peter Abbott wrote: if ( $_ =~ m/^Box(\d) ([A-Z]+(\. | ?)[A-Z]* ?[A-Z]*).*?(\d).*?(\d\d\.\d \d).*?(\d*\.\d\d)L/) { $box, = $1; $name = $2; $place = $4; $time = $5; $margin = $6; $name =~ s/\.//; } Please write

Re: [SLUG] Perl Question

2008-04-02 Thread Matthew Hannigan
On Wed, Apr 02, 2008 at 03:09:44PM +1100, Peter Abbott wrote: Can anyone with greater knowledge than myself explain this regex behaviour. [ ... ] if ( $_ =~ m/^Box(\d) ([A-Z]+(\. | ?)[A-Z]* ?[A-Z]*).*?(\d).*?(\d\d\.\d \d).*?(\d*\.\d\d)L/) { $box = $1; $name =

[SLUG] Perl Question

2008-04-01 Thread Peter Abbott
Can anyone with greater knowledge than myself explain this regex behaviour. This code segment works as intended: if ( $_ =~ m/^Box(\d) ([A-Z]+(\. | ?)[A-Z]* ?[A-Z]*).*?(\d).*?(\d\d\.\d \d).*?(\d*\.\d\d)L/) { $box = $1; $name = $2; $place = $4;

Re: [SLUG] Perl Question

2008-04-01 Thread Amos Shapira
On Wed, Apr 2, 2008 at 3:09 PM, Peter Abbott [EMAIL PROTECTED] wrote: Can anyone with greater knowledge than myself explain this regex behaviour. This code segment works as intended: if ( $_ =~ m/^Box(\d) ([A-Z]+(\. | ?)[A-Z]* ?[A-Z]*).*?(\d).*?(\d\d\.\d \d).*?(\d*\.\d\d)L/) {

Re: [SLUG] Perl Question

2008-04-01 Thread Gonzalo Servat
On Wed, Apr 2, 2008 at 1:09 AM, Peter Abbott [EMAIL PROTECTED] wrote: [..snip..] if ( $_ =~ m/^Box(\d) ([A-Z]+(\. | ?)[A-Z]* ?[A-Z]*).*?(\d).*?(\d\d\.\d \d).*?(\d*\.\d\d)L/) { $box = $1; $name = $2; $name =~ s/\.//; $place = $4;

[SLUG] Perl Question

2008-04-01 Thread Peter Abbott
Thanks to all who replied. I am the wiser now. - Regards, Peter. -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Re: [SLUG] Perl Question

2008-04-01 Thread Rick Welykochy
Peter Abbott wrote: if ( $_ =~ m/^Box(\d) ([A-Z]+(\. | ?)[A-Z]* ?[A-Z]*).*?(\d).*?(\d\d\.\d \d).*?(\d*\.\d\d)L/) { $box = $1; $name = $2; $place = $4; $time = $5; $margin = $6; $name =~ s/\.//;

[SLUG] Perl question

2004-03-07 Thread Alexander Samad
Quick question How can I do this print This is the value .$x-SomeFunc(); as print This is the value $x-SomeFunc(); seems like the substition stops at the - on the second line Alex signature.asc Description: Digital signature -- SLUG - Sydney Linux User's Group Mailing List -

Re: [SLUG] Perl question

2004-03-07 Thread Michael (Micksa) Slade
Alexander Samad wrote: Quick question How can I do this print This is the value .$x-SomeFunc(); as print This is the value $x-SomeFunc(); You can go: print This is the value @{[$x-SomeFunc()]}; But are you sure you want to do that? ;) Mick. -- SLUG - Sydney Linux User's Group Mailing

[SLUG] Perl question

2001-02-18 Thread Michael Lake
Hi All, OK this is a perl Q not Linux but it's Sunday night. :-) Am having probs opening several files in a perl script using indirect filehandles. #!/usr/bin/perl -w # This script reads the ASF's Apache log files and extracts

Re: [SLUG] Perl question

2001-02-18 Thread Crossfire
Michael Lake was once rumoured to have said: Hi All, OK this is a perl Q not Linux but it's Sunday night. :-) Am having probs opening several files in a perl script using indirect filehandles. [Snip] foreach $user (@users) { $fh = new FileHandle " $user"; $fhUser =

Re: [SLUG] Perl question

2001-02-18 Thread Crossfire
Crossfire was once rumoured to have said: But given what it looks like you're trying to do, you probably want to keep many filehandles open at once.. [one for each user], you probably want a construct like: my %userfh; foreach my $user (@users) { $userfh[$user] = new FileHandle "