Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linux withing Perl

Status
Not open for further replies.

hello99hello

Programmer
Jul 29, 2004
50
CA
I am writting Linux script withing a perl program.

I intend to make the following changes in Linux in line HERE HERE HERE HERE HERE (below), I was wondering if you could tell me how:

Changing strings and date - change JAMES LOOKMAN to James Lookman, and date - 12/23/2003 to 23-Dec-2003. Any pointer would be appreciated.

chomp($array[2]);
$array[2] = $array[2]."son" ;
HERE HERE HERE HERE HERE
$new_record = join ',', @array;
 
What's a Linux script?

To do the first part in Perl, read about regular expressions, particularly substitution and the "\l", "\L", "\u", "\U", and "\E" sequences.

The second part should be easy in Perl, too. Split on the slash, map the month to a string, then rearrange with dashes put in...


No idea what a Linux script is. Do you mean a shell script? If so, why would you want to do that? If you have a good reason, look up the "system" command for Perl.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top