Search Results

Search: Posts Made By: D2K
1,651
Posted By Corona688
Make another variable, check if it's not set,...
Make another variable, check if it's not set, make it blank if not, print it.
$var=somethingelse;
if(!defined($var)) $var="";

printf("%s\n", $var);

I suppose you could inject blanks into your...
1,215
Posted By durden_tyler
Not sure if your problem is solved, but here's a...
Not sure if your problem is solved, but here's a solution:


$
$ # The data file
$ cat -n input.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4
5 # This line will...
1,215
Posted By spacebar
Try it using just these two regular expressions: ...
Try it using just these two regular expressions:
$line[$i] =~ s/[\W\s]/ /g;
$line[$i] =~ s/ \w | \w\w |\s/g;
2,822
Posted By rdrtx1
$string =~ s/\b[^ \t]\b//g;
$string =~ s/\b[^ \t]\b//g;
1,259
Posted By birei
eq is for comparing strings. To check regular...
eq is for comparing strings. To check regular expression use =~ without double quotes:

if ($ARGV[0] =~ m/^-(\d+)$/) { print "I think it works\n"; }
Showing results 1 to 5 of 5

 
All times are GMT -4. The time now is 01:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy