Re: How to redefine the default escape character

2009-10-27 Thread mahesh bhasme
Hi Vijay, I don't think that we change default character because it's in perl's inbuild code. Thanks, Mahesh On Wed, Oct 28, 2009 at 9:05 AM, Vijay Gururaja wrote: > Hi, All! > > The default character to escape is backslash (\). Is there any way to > redefine this and set it to any other char

Re: How to redefine the default escape character

2009-10-27 Thread Uri Guttman
> "VG" == Vijay Gururaja writes: VG> Hi, All! VG>The default character to escape is backslash (\). Is there any way VG> to redefine this and set it to any other character? VG>For e.g. if I wanted to use '^' instead of '\'. VG>*print "Hello World ^n";* it can't be done

How to redefine the default escape character

2009-10-27 Thread Vijay Gururaja
Hi, All! The default character to escape is backslash (\). Is there any way to redefine this and set it to any other character? For e.g. if I wanted to use '^' instead of '\'. *print "Hello World ^n";* Thanks, Vijay Gururaja

Re: printf

2009-10-27 Thread Uri Guttman
> "AC" == Aimee Cardenas writes: AC> Awesome! Thanks, David! :-D you can do it is true. but you should have been able to figure it out on your own with simple logic or checking the docs. arguments to perl's functions are just normal values and expressions. they may be converted to someth

Re: printf

2009-10-27 Thread Aimee Cardenas
Awesome! Thanks, David! :-D Aimee Cardenas On Oct 27, 2009, at 4:56 PM, Wagner, David --- Senior Programmer Analyst --- CFS wrote: -Original Message- From: Aimee Cardenas [mailto:aim...@sfbrgenetics.org] Sent: Tuesday, October 27, 2009 15:53 To: Perl Beginners Subject: printf Hi

printf

2009-10-27 Thread Aimee Cardenas
Hi, All! I need to fix the width of some strings padding with leading spaces if necessary. I wanted to use printf but I don't know if you can put a variable in the format part the the printf statement. For example, if I wanted to use the following format type: printf OFILE "%7s\n", $str

recommendations for run-time assertions

2009-10-27 Thread David Christensen
beginners: I'm starting on an OO module, and have put some run-time assertion subroutines into a function library: our %EXPORT_TAGS = ( 'all' => [ qw( assert_argument_present assert_arguments_gone assert_class_method_signature assert_defined

Re: About the hash case insensitive ~~~

2009-10-27 Thread Shlomi Fish
On Tuesday 27 Oct 2009 13:50:16 Majian wrote: > Hello,all: > I had a question about the perl hash case insensitive . > > And I had this script : > == > #!/usr/bin/perl > use warnings; Just a note - you're missing the "use strict;" pragma which is a big no

Re: About the hash case insensitive ~~~

2009-10-27 Thread Majian
Thanks all ~ when I type this command "perldoc -f uc", then find this : uc EXPR uc Returns an uppercased version of EXPR. This is the internal function implementing the "\U" escape in double-quoted strings. Respects current LC_CTYPE locale if "use locale" in force. See perllocale an

AW: About the hash case insensitive ~~~

2009-10-27 Thread Thomas Bätzler
Majian asked: > %courses = ( > "2CPR2B"=> "C Language", > "1UNX1B"=> "Intro to Unix", > "3SH414"=> "Shell Programming", > "4PL400"=> "Perl Programming", > ); > > print "\n\"EDP\" NUMBERS AND ELECTIVES:\n"; > while (($n

RE: About the hash case insensitive ~~~

2009-10-27 Thread Hack, Gabi (ext)
use uc() to convert to upper case (see below): chomp ($num = uc()); -Original Message- From: Majian [mailto:jian...@gmail.com] Sent: Tuesday, October 27, 2009 12:50 PM To: Perl Beginners Subject: About the hash case insensitive ~~~ Hello,all: I had a question about the perl hash case ins

Re: About the hash case insensitive ~~~

2009-10-27 Thread Dermot
2009/10/27 Majian : > Hello,all: > I had a question about the perl hash case insensitive . > > And I had  this script : > == > #!/usr/bin/perl > use warnings; > %courses = ( >             "2CPR2B"    => "C Language", >             "1UNX1B"    => "Intro to Uni

About the hash case insensitive ~~~

2009-10-27 Thread Majian
Hello,all: I had a question about the perl hash case insensitive . And I had this script : == #!/usr/bin/perl use warnings; %courses = ( "2CPR2B"=> "C Language", "1UNX1B"=> "Intro to Unix", "3SH414"=> "Shel

Re: split n characters into n chunks

2009-10-27 Thread Dr.Ruud
Shawn H Corey wrote: Dr.Ruud wrote: push @list, unpack "x${_}a$size", $word for 0 .. $max; Funnily enough, that is somehow&what faster than push @list, map unpack( "x${_}a$size", $word ), 0 .. $max; You don't need the push: my @list = map unpack( "x${_}a$size", $word ), 0 .. $max;

Re: split n characters into n chunks

2009-10-27 Thread mahesh bhasme
Hi, you can use substr $myword, 1,3 function Thanks, Mahesh On Sun, Oct 25, 2009 at 3:13 PM, Michael Alipio wrote: > Hi, > > How do I split a word into n subsets? > > my $word = "thequickbrown" > > > If I want three subsets I should be able to create: > > the > heq > equ > > upto > >