lways have the best answer.
-Original Message-
From: Javeed SAR [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 2:45 PM
To: Timothy Johnson
Subject: RE: splitting string
#!c:\perl\bin\perl
$PN="$ENV{'CLEARCASE_PN'}";
($FNAME, $FEXTENSION)=split(/\./,$PN
Try:
use File::Basename;
my $direx = 'E:/Perl/bin/extra/nodir/hi.txt';
my ($name, $path, $suffix, @stuff);
while (1) {
($name, $path, $suffix) = fileparse($direx);
last if $name eq '.';
print "Name is $name\n";
push @stuff, $name;
chop($path);
$direx = $path;
}
foreach (@stuff) {
print"\t$
: Friday, August 09, 2002 2:39 PM
To: Timothy Johnson
Subject: RE: splitting string
i am getting this error i am working on NT
syntax error at \\blrk35ed\javeed\unresco.pl
line 11, near "$FNAME=~ s/\"
Execution of \\blrk35ed\javeed\unresco.pl
aborted due to compilation errors.
ECTED]]
Sent: Friday, August 09, 2002 2:15 PM
To: Timothy Johnson
Subject: RE: splitting string
My requirement is like this:
Soarian_Context_Sensitive_Coordination_File ---> in one variable.
test---> in one variable
train--->in one variable
sun1--
>
> I think your subject answers your question: split() the string.
>
> E.g. @path = split(/\/,$string);
>
> should give you the right result.
yep and to take a step further:
($var1, $var2, $var3...) = split(/\/,$string);
>
> -Original Message-
> From: Javeed SAR [mailto:[EMAIL PRO
I think your subject answers your question: split() the string.
E.g. @path = split(/\/,$string);
should give you the right result.
-Original Message-
From: Javeed SAR [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 2:07 PM
To: [EMAIL PROTECTED]
Subject: splitting string
hi
Wow, you have some good problems. Only solution I was able to come up
with was something like this:
$s = '[EMAIL PROTECTED], "Blow, Joe" <[EMAIL PROTECTED]>,Joe Blow
<[EMAIL PROTECTED]>';
while($s) {
# This is to match [EMAIL PROTECTED]
if($s =~ /^([\w._]+\@[\w._]+),?\s*/) {
$s = $';
Brian <[EMAIL PROTECTED]> wrote:
>
> I'm way rusty on my regexp's (been on vacation for a month without doing
> any) but try this:
>
> $s =~ m/^([^,]+),\s*(\".+\>),(.+)/;
>
> $1 will be "[EMAIL PROTECTED]"
> $2 will be '"Blow, Joe" <[EMAIL PROTECTED]>'
> $3 will be "Joe Blow <[EMAIL PROTECTED]>
There is a module Text::CSV_XS that handles (surprise!) CSV files, which
understands quoted strings with commas. I can make it work, so it must be
easy
-Original Message-
From: Mike Miller [mailto:[EMAIL PROTECTED]]
Sent: 18 July 2001 02:47
To: [EMAIL PROTECTED]
Subject: Splitting string
I'm way rusty on my regexp's (been on vacation for a month without doing
any) but try this:
$s =~ m/^([^,]+),\s*(\".+\>),(.+)/;
$1 will be "[EMAIL PROTECTED]"
$2 will be '"Blow, Joe" <[EMAIL PROTECTED]>'
$3 will be "Joe Blow <[EMAIL PROTECTED]>"
This will work as long as all the lines are in th
This seems like more of a job for regexp than for split. Is there any
reason not to use regexp in your particular case?
Brian Johnson
Partner/Systems Administrator/Programmer
Source1Hosting.tv, LLC (www.source1hosting.tv)
Source1Results.com, LLC (www.source1results.com)
I may be insane, but reme
11 matches
Mail list logo