That was my typo.  The correct statement is
 
($var1,$var2,$var3,$var4,$var5) = split(/\\/,$FNAME);
 
The backslash is uset to escape other characters, so two backslashes must be
used.
 
Again, though, please post to the list.  I am at work, and can't always
answer, and I don't even always 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);
 
 
 
#print "$FEXTENSION\n";
print "$FNAME\n";                   # The output here is
M:\sun1\train\test\Soarian_Context_Sensitive_Coordination_File 
 
my($var1,$var2,$var3,$var4,$var5) = split(/\/,$FNAME);
 print "$var5";
#$FNAME=~ s/\\/\\\\/g;
if(($ENV{'CLEARCASE_RESERVED'} == 0) && ($FNAME=~
m/Soarian_Context_Sensitive_Coordination_File.xls/) | ($FNAME =~
m/comEPRHelp.ini/) | ($FNAME =~
m/CDMS_Context_Sensitive_Coordination_File.xls/) | ($FNAME =~
m/CDMS_Soarian_ToC_1.2b.xls/) | ($FNAME =~ m/CDMScomEPRHelp.ini/))
{
 
   $PROMPT="\"The element ($FNAME) is not allowed to be
checkedout(unreserved).please  contact Clearcase administrator or javeed
(Extn 4919)\"";
   exec ("clearprompt yes_no -mask abort -default abort -pre -pro $PROMPT");
   exit 0;
}
 

 
 

Regards 
Javeed 

: Timothy Johnson [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 7:12 PM
To: Javeed SAR; '[EMAIL PROTECTED]'
Subject: RE: splitting string


You should direct your questions to the list.  I will help you if I can.
You might also want to post more code.  The line you are referring to has
nothing to do with your original question.  What syntax are you using?

-----Original Message-----
From: Javeed SAR [mailto:[EMAIL PROTECTED]]
Sent: 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
<file://\\blrk35ed\javeed\unresco.pl>  line 11, near "$FNAME=~ s/\"
Execution of \\blrk35ed\javeed\unresco.pl
<file://\\blrk35ed\javeed\unresco.pl>  aborted due to compilation errors.
 

Regards 
Javeed 


-----
From: Timothy Johnson [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 09, 2002 6:56 PM
To: Javeed SAR; '[EMAIL PROTECTED]'
Subject: RE: splitting string



Then something like this:
 
my($var1,$var2,$var3,$var4,$var5) = split(/\/,$string);
 
BTW, to avoid confusion, you should probably be referring to "one variable"
as "one scalar", or something more specific.

-----Original Message-----
From: Javeed SAR [mailto:[EMAIL PROTECTED]]
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--->         in one variable 
M:--->   in one variable 


TIA 
Regards 
Javeed 



-----Original Message----- 
From: Timothy Johnson [ mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> ] 
Sent: Friday, August 09, 2002 6:42 PM 
To: Javeed SAR; [EMAIL PROTECTED] 
Subject: RE: splitting string 



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]
<mailto:[EMAIL PROTECTED]> ] 
Sent: Friday, August 09, 2002 2:07 PM 
To: [EMAIL PROTECTED] 
Subject: splitting string 


hi All, 


I have string as given below: 

M:\sun1\train\test\Soarian_Context_Sensitive_Coordination_File 

>From this string i need to split indivually and get   
        
Soarian_Context_Sensitive_Coordination_File     --->   in one variable. 
                                        test 
--->         in one variable 
                                        train 
--->     in one variable                
                                        sun1 
--->     in one variable 
                                        M: 
--->     in one variable 



Regards 
Javeed 

Regards 
Javeed 

Reply via email to