This sounds like the perfect time for a split()

my($var1,$var2) = split /#/,$line;

perldoc -f split

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 18, 2002 7:49 AM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: a question of regular expression


Dear all,
I have a line like this:
notepad test.txt # This is a test. 

I want to put seprate the line into two by "#", like

var1 = "notepad test.txt"
var2 = "This is a test." (I do not want to include # sign)

How can I do?

Thanks a lot inadvance!

Lixin
 
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to