Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: hash problem

by licking9Volts (Pilgrim)
on May 21, 2002 at 15:57 UTC ( #168169=note: print w/replies, xml ) Need Help??

in reply to uninitialized value on hash lookup (was: hash problem)

It looks like $Line isn't getting a value assigned to it. I think your split command should have parentheses around the regexp:
my ($Line, $Filed, $Dvalue) = split(/\t/);
If you're splitting a record on tabs, you might want to check if multiple tabs separate the fields. If so, you could use:
my ($Line, $Filed, $Dvalue) = split(/\t+/);
I'm a beginner PERL user but I hope that helps.

Update: Changed /\t*/ to /\t+/ to avoid unexpected results. Thanks esper!

Replies are listed 'Best First'.
Re: Re: hash problem
by dsheroh (Prior) on May 21, 2002 at 16:10 UTC
    Just one minor detail: You want to split on /\t+/ instead of /\t*/ since the * will also match 0 tabs and could split within a field (since there are 0 tabs between every pair of characters) instead of only between fields.
Re: Re: hash problem
by Anonymous Monk on May 21, 2002 at 17:09 UTC

    Thank you for your help!
    My first file is a table:
    Line Field Dvalue
    a123 A1 12.83
    a124 A1 9.68
    and second file is a table too:
    Name Data
    a123 acgt...(whole sequence)
    a124 catt...
    both table all use tab to separate each column. Please help!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://168169]
[karlgoethebier]: crawls back to his cell
[shmem]: karlgoethebier: they even program in php to avoid perl. Go figure.
[LanX]: hng
[shmem]: ?
[LanX]: awk! o/

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2018-03-20 18:49 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (258 votes). Check out past polls.