helmex has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I am having problems splitting a string.
The string looks like this
$string=\\Server\user;
or sometimes
$string=\\Server\dir\user;
I tried to use the following statment:
@tmp=split(/\/,$string);
and
@tmp=split(/\\/,$string);
But when I try to print out elements of @tmp I get blank lines.
Does anybody have any suggestions?
%^+^%
The string looks like this
$string=\\Server\user;
or sometimes
$string=\\Server\dir\user;
I tried to use the following statment:
@tmp=split(/\/,$string);
and
@tmp=split(/\\/,$string);
But when I try to print out elements of @tmp I get blank lines.
Does anybody have any suggestions?
%^+^%
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Splitting blunder
by Juerd (Abbot) on Apr 08, 2002 at 18:11 UTC | |
Re: Splitting blunder
by swiftone (Curate) on Apr 08, 2002 at 18:10 UTC | |
by Juerd (Abbot) on Apr 08, 2002 at 18:13 UTC | |
Re: Splitting blunder
by extremely (Priest) on Apr 08, 2002 at 18:10 UTC | |
Re: Splitting blunder
by perlplexer (Hermit) on Apr 08, 2002 at 18:18 UTC | |
Re: Splitting blunder
by perigeeV (Hermit) on Apr 08, 2002 at 19:00 UTC | |
by helmex (Initiate) on Apr 08, 2002 at 23:26 UTC |
Back to
Seekers of Perl Wisdom