LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-03-2005, 03:17 PM   #1
linuxmandrake
Member
 
Registered: Sep 2004
Distribution: debian sarge 64bit (AMD)
Posts: 709

Rep: Reputation: 30
split command in perl not splitting /


#!/usr/bin/perl
$string = "welcome/to/tizag.com/";
$out = split ("/\//",$string);

print $out;

oops I sorted it now thanks

Last edited by linuxmandrake; 11-03-2005 at 03:24 PM.
 
Old 11-03-2005, 03:28 PM   #2
zak317
Member
 
Registered: Oct 2005
Location: 500$/monthly
Distribution: Mandriva 2006
Posts: 56

Rep: Reputation: 15
Because you must put the split result in an array...
Something like this:

#!/usr/bin/perl
$string = "welcome/to/tizag.com/";
@out = split (/\//,$string);

print $out[0];

Cheers!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl Help (possible split) fooforon Programming 2 02-19-2004 05:53 AM
PERL: split on html tag? ocularbob Programming 12 09-08-2003 05:52 PM
problem splitting a $ in perl joesbox Programming 7 08-30-2003 11:11 AM
perl string split problem! farhanali Programming 4 06-22-2003 07:08 AM
perl split(@array)?? wtf? bobjones Programming 5 09-23-2002 09:41 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration