Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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]
[Corion]: Oof - "Anyway, if it is not obvious, please keep this discussion entirely confidential for now.", as seen on a public mailing list ;)
[Discipulus]: uh no choroba.. i do not practice much with online putyour image sites:can you suggest one (that possibly remove the pic after few days)?
[choroba]: Corion a bug report?
[choroba]: I have no idea :-( I used to post to, but they don't seem to feature "private" pictures in the free version now
[Discipulus]: dazz i'm not an experts but i think it would be possible
[Corion]: dazz: I think Image::Magick can "read" from an in-memory filehandle
[Corion]: choroba: No, some general admin discussion of how to handle (company) user accounts
[Discipulus]: might be it is necessary to pass the pic data like MIME::Base64:: encode( data..
[Discipulus]: if you have a jpeg data: or as wise Corion said IM ca n read directly your handle

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2017-03-27 07:56 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (317 votes). Check out past polls.