<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Convert variable to uppercase in perl in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/convert-variable-to-uppercase-in-perl/m-p/3346089#M13451</link>
    <description>Forgive me if someone replied to this already ask i'm trying to catch up on email after vacation. There is an easier way to do this by using the 'uc' function such as:&lt;BR /&gt;&lt;BR /&gt;print $f join "," =&amp;gt; $acode.$a[0],uc $bld, $room, $a[1], $a[2], "\n";&lt;BR /&gt;&lt;BR /&gt;Or you can use ucfirst $_ to set the first character to upper case such as: &lt;BR /&gt;ucfirst lc $_&lt;BR /&gt;&lt;BR /&gt;Perl rules...</description>
    <pubDate>Thu, 26 Aug 2004 17:58:37 GMT</pubDate>
    <dc:creator>Bryan Dees</dc:creator>
    <dc:date>2004-08-26T17:58:37Z</dc:date>
    <item>
      <title>Convert variable to uppercase in perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/convert-variable-to-uppercase-in-perl/m-p/3346087#M13449</link>
      <description>I have a script that prompts a user for input.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I need to make this into uppercase.&lt;BR /&gt;Bere in mind that I also cut the first 4 letters off the use as a variable for a file name.&lt;BR /&gt;&lt;BR /&gt;I need what ever the use types in both prompts to be in uppercase.&lt;BR /&gt;&lt;BR /&gt;print "Enter BLD: ";&lt;BR /&gt;chomp (my $bld = &lt;STDIN&gt;);&lt;BR /&gt;my $bld4=substr $bld,0,4; #Pull first 4 char out of BLD for naming of file&lt;BR /&gt;&lt;BR /&gt;print "Enter in room:";&lt;BR /&gt;chomp (my $room = &lt;STDIN&gt;);&lt;BR /&gt;&lt;BR /&gt;open my $fc, "&amp;gt;$bld4.cust_has" or die "$bld4.cust_has: $!";&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have tried when I print to do the \U but I get an error...&lt;BR /&gt;&lt;BR /&gt;print $f join "," =&amp;gt; $acode.$a[0],\U$bld, $room, $a[1], $a[2], "\n";&lt;/STDIN&gt;&lt;/STDIN&gt;</description>
      <pubDate>Fri, 30 Jul 2004 15:34:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/convert-variable-to-uppercase-in-perl/m-p/3346087#M13449</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2004-07-30T15:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Convert variable to uppercase in perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/convert-variable-to-uppercase-in-perl/m-p/3346088#M13450</link>
      <description>Why not just use a simple:&lt;BR /&gt;&lt;BR /&gt;y/[a-z]/[A-Z]/;&lt;BR /&gt;&lt;BR /&gt;? like this:&lt;BR /&gt;&lt;BR /&gt;print "Enter BLD: ";&lt;BR /&gt;chomp($_ = &lt;STDIN&gt;);&lt;BR /&gt;y/[a-z]/[A-Z]/;&lt;BR /&gt;my $bld4 = substr( $_, 0, 4 );&lt;/STDIN&gt;</description>
      <pubDate>Fri, 30 Jul 2004 20:15:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/convert-variable-to-uppercase-in-perl/m-p/3346088#M13450</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2004-07-30T20:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Convert variable to uppercase in perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/convert-variable-to-uppercase-in-perl/m-p/3346089#M13451</link>
      <description>Forgive me if someone replied to this already ask i'm trying to catch up on email after vacation. There is an easier way to do this by using the 'uc' function such as:&lt;BR /&gt;&lt;BR /&gt;print $f join "," =&amp;gt; $acode.$a[0],uc $bld, $room, $a[1], $a[2], "\n";&lt;BR /&gt;&lt;BR /&gt;Or you can use ucfirst $_ to set the first character to upper case such as: &lt;BR /&gt;ucfirst lc $_&lt;BR /&gt;&lt;BR /&gt;Perl rules...</description>
      <pubDate>Thu, 26 Aug 2004 17:58:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/convert-variable-to-uppercase-in-perl/m-p/3346089#M13451</guid>
      <dc:creator>Bryan Dees</dc:creator>
      <dc:date>2004-08-26T17:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Convert variable to uppercase in perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/convert-variable-to-uppercase-in-perl/m-p/3346090#M13452</link>
      <description>Another way to do it is to call the tr command from the perl script:&lt;BR /&gt;&lt;BR /&gt;tr '[:lower:]' '[:upper:]'&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Ross</description>
      <pubDate>Mon, 06 Sep 2004 21:36:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/convert-variable-to-uppercase-in-perl/m-p/3346090#M13452</guid>
      <dc:creator>Ross Minkov</dc:creator>
      <dc:date>2004-09-06T21:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Convert variable to uppercase in perl</title>
      <link>https://community.hpe.com/t5/operating-system-linux/convert-variable-to-uppercase-in-perl/m-p/3346091#M13453</link>
      <description>First do all the necessary actions,then print the result.&lt;BR /&gt;For example:&lt;BR /&gt;print "Enter some long word\n";&lt;BR /&gt;chomp ($var=&lt;STDIN&gt;);&lt;BR /&gt;$var=~s/^....(.*)/$1/;&lt;BR /&gt;$var=~s/$var/\U$var/;&lt;BR /&gt;print "$var\n";&lt;BR /&gt;Regards.&lt;/STDIN&gt;</description>
      <pubDate>Tue, 07 Sep 2004 01:35:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/convert-variable-to-uppercase-in-perl/m-p/3346091#M13453</guid>
      <dc:creator>Alexander Chuzhoy</dc:creator>
      <dc:date>2004-09-07T01:35:30Z</dc:date>
    </item>
  </channel>
</rss>

