tr problem
From: IanW (onedoesnot_at_needto.know)
Date: 09/30/04
- Next message: Tore Aursand: "Re: assign a left hand variable to a variable"
- Previous message: Tintin: "Re: Sample perl code does not work (from Perl cookbook, 2nd ed.)"
- Next in thread: Tore Aursand: "Re: tr problem"
- Reply: Tore Aursand: "Re: tr problem"
- Reply: Anno Siegel: "Re: tr problem"
- Reply: John W. Krahn: "Re: tr problem"
- Reply: Christian Winter: "Re: tr problem"
- Reply: Joe Smith: "Re: tr problem"
- Reply: Jürgen Exner: "Re: tr problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Sep 2004 09:13:07 +0100
If I have a string like this
"listname A short description of the list"
and I want to make the "listname" part of the string upper case, how can I
do this with tr///?
Incidentally, "listname" will never have any spaces in it and will always be
at the beginning of the string, so I had thought that sth like this might
work, but it just makes the whole thing upper case:
$_ =~ tr/^a-z+(?=\s+)/A-Z/;
Ian
- Next message: Tore Aursand: "Re: assign a left hand variable to a variable"
- Previous message: Tintin: "Re: Sample perl code does not work (from Perl cookbook, 2nd ed.)"
- Next in thread: Tore Aursand: "Re: tr problem"
- Reply: Tore Aursand: "Re: tr problem"
- Reply: Anno Siegel: "Re: tr problem"
- Reply: John W. Krahn: "Re: tr problem"
- Reply: Christian Winter: "Re: tr problem"
- Reply: Joe Smith: "Re: tr problem"
- Reply: Jürgen Exner: "Re: tr problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|