Re: first glimpse of regex

2002-03-19 Thread Patrick Diffley
One way of doing this: chop ($username); if ($username eq "") { ... } This will at least ensure that a carriage return is not included in the scalar PJD - Original Message - From: "Matthew Harrison" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday,

Re: How To Get Rid Of Excess Blank Lines at The End Of File?

2002-04-01 Thread Patrick Diffley
This may help..a very basic file I/O open(INFILE,"yourfile"); open (OUTFILE,"outfilename"); while ($line=) { chomp $line; next if ($line eq ""); print OUTFILE $line; } You could also slurp it into an array, but - Original Message - From: "Kim, Kiseok" <[EMAIL PROTECTED]> To: <[EM

Re: newline issue

2002-04-10 Thread Patrick Diffley
You might want to try using the input line separator system variable "$/". By default it is "\n", but you can set it to whatever you like e.g. $/ = " "; #This makes the newline character a whitespace so then $testValue1 = "a b"; might be what you want to accomplish, I'm not sure, Hope this hel

Re: $_ and while stmt

2002-05-01 Thread Patrick Diffley
Try this: for ($i=0; $i<@inlocation; $i++) { print ("Error location is required\n") if ( $inlocation[$i] !~ /\w+/); } - Original Message - From: "Scot Robnett" <[EMAIL PROTECTED]> To: "Teresa Raymond" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, May 01, 2002 8:03 PM