You have to try as,
 $var=~operation;
 Example:
 # perl -e '$var="HIbyeok";$var=~s/HI/OK/;printf $var . "\n";'
OKbyeok
 -Muthu
 On 10/5/05, BERTHOLD Jean <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I try to replace my old shells scripts with perl ...
>
> Can you tell me how to extract a substring in upper case from a variable
> and assign that substring to a variable ?
>
> Do I need to proceed character by character using a loop to recognize each
> upper case or can I do that by using regular expression ?
>
> In shell scripts, of course I use awk. Then I cannot find it's equivalent
> in perl.
>
> For example, I need to extract the word "DIVERS" from the filename
> "rman_DIVERS-archivelog-29-09-05-0330.log" and assign this word to a
> variable.
>
> In shell script this is done by something like that:
> --------------------------------------------------------------------------
> gauche=`ls rman_DIVERS-archivelog-29-09-05-0330.log | awk -F- '{print
> $1}'`
> ORACLE_SID=`echo $gauche | awk -F_ '{print $2}'`
>
> And in Perl, can you help me ?
>
> Thanks and have a nice day !
>
> E O S H o l d i n g
>
> Jean Berthold
>
> Administrateur Unix & Oracle
>
> Unité Gestion de l'infrastructure
>
> Team Systèmes
>
> Ch. de Mornex 10
>
> Tel +41 21 341 24 58
>
> Fax +41 21 341 20 46
>
> [EMAIL PROTECTED]
>
>
>

Reply via email to