Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^2: Help with regex

by ChuckularOne (Parson)
on Sep 28, 2007 at 16:40 UTC ( #641570=note: print w/replies, xml ) Need Help??

in reply to Re: Help with regex
in thread Help with regex

My data must be something other than what I think it is. I'll revisit it. Thanks.

Replies are listed 'Best First'.
Re^3: Help with regex
by gam3 (Curate) on Sep 28, 2007 at 17:28 UTC
    You might try m/^1\s*$/ for your regular expression.
    -- gam3
    A picture is worth a thousand words, but takes 200K.
Re^3: Help with regex
by Not_a_Number (Parson) on Sep 28, 2007 at 16:52 UTC

    How are you populating your @fileData array? Is there any reason not to iterate over the filehandle directly?

    use strict; use warnings; my $infile = 'whatever'; open my $fh, '<', $infile or die "Couldn't open '$infile' for read: $! +\n"; while ( my $line = <$fh> ) { print "$.\n" if $line =~ m/^1$/; }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://641570]
[LanX]: shmem: but only because it is taught in school
LanX remembers one curriculum about benny and the punishment whe we didn't laugh ...hill
LanX horror
[Discipulus]: in case of doubt freedom

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2017-04-27 20:13 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (513 votes). Check out past polls.