Forum Moderators: coopster & phranque

Message Too Old, No Replies

uc string manipulation in Perl

Question about how to use the uc function in Perl

         

gnotellaluvr

12:11 am on Jun 7, 2005 (gmt 0)

10+ Year Member



I am in the process of trying to code a Perl script and this is my first time using the uc function. I have a section that gets the input and returns it to a if statement:

sub get_input {
return param('name'), param('serial'), param('model'), param('system');
}

Can I do something like:

param(uc('serial'))

I need to be able to get this done so I run a validation against the serial number input.

wruppert

4:19 am on Jun 7, 2005 (gmt 0)

10+ Year Member



uc(param('serial'))
will return the upper case value of the parameter.

param(uc('serial')) is the same as param('SERIAL'), not what you wanted in this case.

gnotellaluvr

2:03 am on Jun 8, 2005 (gmt 0)

10+ Year Member



Thanks WR. I just had the two confused. Thank you very much.