Man, newlines *really* know how to piss me off! I am trying to get rid of some in a string. The output is something like;
var targetURL="admin.cgi?do=plugin&plugin=Real_Spider&func=spider_run&urls=http://www.google.com/ads/,http://www.google.com/services/&IGNORE_RULES=0&SEARCH_FOR_ALL=jobs
,service&SEARCH_FOR_EXCLUDING=tools"
The code is;
my $_EXCLUDING = $EXCLUDING; chomp($_EXCLUDING); $_EXCLUDING =~ s/\n/,/g;
$_EXCLUDING =~ s/\s$//; # get rid of triling slashes..
$_RULES =~ s/\s$//; # get rid of triling slashes..
$_EXCLUDING =~ s/^\s//; # get rid of leading slashes..
$_RULES =~ s/^\s//; # get rid of leading slashes..
*why* oh why isn't it removing the newline? (notice the bit after 'services' in the output). I've tried getting rid of \t and \r too, but there the new line STILL remains! Its driving me mad.
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
var targetURL="admin.cgi?do=plugin&plugin=Real_Spider&func=spider_run&urls=http://www.google.com/ads/,http://www.google.com/services/&IGNORE_RULES=0&SEARCH_FOR_ALL=jobs
,service&SEARCH_FOR_EXCLUDING=tools"
The code is;
Code:
my $_RULES = $RULES; chomp($_RULES); $_RULES =~ s/\n/,/g; my $_EXCLUDING = $EXCLUDING; chomp($_EXCLUDING); $_EXCLUDING =~ s/\n/,/g;
$_EXCLUDING =~ s/\s$//; # get rid of triling slashes..
$_RULES =~ s/\s$//; # get rid of triling slashes..
$_EXCLUDING =~ s/^\s//; # get rid of leading slashes..
$_RULES =~ s/^\s//; # get rid of leading slashes..
*why* oh why isn't it removing the newline? (notice the bit after 'services' in the output). I've tried getting rid of \t and \r too, but there the new line STILL remains! Its driving me mad.
Cheers
Andy (mod)
andy@ultranerds.co.uk
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates

