Gossamer Forum
Home : Products : DBMan : Discussions :

problem on extract the db file from DBMan

Quote Reply
problem on extract the db file from DBMan
Hi all,

I tried to extract the data from dbman. I've a problem of using split () in Perl.
Quote:
($ID,$Number,$Name,$Date,$Time,$Size)= split(/|/, $_);
print ("$ID\n", "$Number\n", "$Name\n", "$Date\n", "$Time\n", "$Size\n");

I tried to split the pattern '|', however, I cannot get the correct answer. Instead it split every single letter for me.

Say
Quote:
$_ = '20|20|cary|20-Mar-2002|05:30:30|3'
It returns
2
0
|
2
0
|

Any help?

Thanks
Cary
Quote Reply
Re: [caryhung] problem on extract the db file from DBMan In reply to
change:

split(/|/, $_);

to:

split /\|/;
Quote Reply
Re: [Paul] problem on extract the db file from DBMan In reply to
Hi Paul,

It works fine! Smile

Thanks
Cary