Jan
18
awarded Yearling
Jun
8
awarded Caucus
Feb
15
comment Rogue Character in tab delimited file causing error
A substitution using a regular expression is NOT the Right Tool for this job. The Right Tool for working on individual characters, rather than on patterns of characters, is the transliteration operator: tr/\r//d;
Feb
11
answered Problems check username input against flat file for user creation
Feb
11
comment Problems check username input against flat file for user creation
You will have a race condition here that will mess up your registration system. You must figure out how to lock out other processes from updating your list of accounts until your current program finished execution and releases its lock. Locking files is workable but not as easy as storing the info in a proper DB that will handle locking for you...
Feb
9
comment In perl, how do I replace a set of characters with a different set of characters in a single pass?
regexes are absolutely not the Right Tool for this job. tr/// is.
Feb
7
comment Perl Out Of Memory
You should always enable warnings (use warnings) when developing Perl code.
Feb
1
comment What is the difference of using special variable $_ and @_ in Perl?
Errr, something very special indeed happens when you assign to @_ in a subroutine, eg: sub addX { $_[0] .= 'X' } my $foo='foo'; addX($foo); print $foo; # :-)
Jan
31
comment Read file left to right
-1 for no code.
Jan
31
comment formatting text with perl
tr/\n//d; is better than s///g here (because we are dealing with characters rather than patterns).
Jan
31
comment How can I search for two sequential newlines (\n) using perl?
Your Question is Asked Frequently, "I'm having trouble matching over more than one line. What's wrong?" learn.perl.org/faq/…
Jan
31
answered Comment XML lines beginning with specific string using perl -p -ie
Jan
23
comment What do the constructs `<DATA>`, `chomp` and `shift` do in this file reading function?
chomp does not behave even near to what you claim here. chomp will NOT "cut off all whitespace"! chomp will delete the value of $/ (normally newline) if it is at the end of the string, else it will do nothing at all.
Jan
23
answered What do the constructs `<DATA>`, `chomp` and `shift` do in this file reading function?
Jan
21
comment Perl substitute with regex
A regex either "matches" or "fails to match". Nobody knows what "pick up" means when you say it...
Jan
19
answered How do you parse HTML file on Solaris 10 UNIX box to put all values within <td> elements into CSV file?
Jan
19
comment Rename directory names recursively
when you have "product images" and "product_images" directories already in existence then what should happen?
Jan
16
answered perl - use split or regular expression to get directory names from text file
Jan
14
answered perl emulate grep -n?
Jan
13
awarded Nice Answer
1 2 3 4 5