Jorge Goncalves wrote:
Hi List , I have this to print:
1
2
3
with this script but it didn't work:
No, it does not even compile. :(
while ($file =~ /^\s+(\d+).(.+)$/) {
You always need the /g modifier when using the m// operator that way
in a while loop. In this case you also need the /m modif
Goncalves, Jorge (Ext) wrote:
> Hi List , I have this to print:
> 1
> 2
> 3
>
> with this script but it didn't work:
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> {
> local $/;
> my $file = ;
> while ($file =~ /^\s+(\d+).(.+)$/) {
> print $1\n if $2 =~ /extractStat/
Jorge Goncalvez wrote:
> Hi, i have this:
> open INFILE, "< $_Globals{SYSLOG}" or die $!;
> #ModifiedFile();
> while () {
> if (/([0-9a-z:]+)\s*via eth0)/) {
> $_Globals{MAC_ADDR} = $1;
>}
> }
> And my file is like this:
> .
> LOG_INFO :
On Tuesday, May 14, 2002, at 06:16 , Jorge Goncalvez wrote:
[..]
>
> And I wanted to extract Guest (without the quotes)i tried this:
that could be your problem - the /PATTERN/i - is
for 'case insensitive' - hence would catch both DOG and dog or dOg
[..]
>
>
> It didn't worked why? What's wro
> Hi, I have a file like this:
> ...
> SceInfEveryone = "Everyone"
> SceInfGuests = "Guests"
> SceInfGuest = "Guest"
> SceInfPowerUsers = "Power Users"
> SceInfPrintOp = "Print Operators"
> ..
>
> And I wanted to extract Guest (without the quotes)i tried this:
>
> my $HISEFILE= "c:/h
> -Original Message-
> From: Jorge Goncalvez [mailto:[EMAIL PROTECTED]]
> Subject: re:Regexp needed
>
>
> hi, i have this:
> my ($Path) = $MountsPath =~ /(.+?)cygwin/;
> but I wanted to get rid of the "/".
> because $MountsPath could be c:/cygwin or c:/xyz/cygwin or
> c:/xyz/zyx/cygwin