I can think of a few approaches...
1. write a subroutine to do this.
2. write a source filter
(http://www.samag.com/documents/s=1287/sam03030004/)
3. use tie
I would probably choose the third. It is possible to create a module that
you simulate a filehandle (or hash, or array, etc). The short
a) Has anybody observed any **serious** performance degradation with
PerlScript engine of AS?
I haven't worked with PerlScript in ASP for two years now, but never saw
*any* performance problems when I did... well except for DB connections not
closing, but that was my fault.
b) Anybody observed
> keeps saying it can't find it!
Now that is funny. Just be aware that it will make your module a lot larger
if you use it... it uses whitespace to denote characters, so the word
"print" in your code will take up 5 lines (one for each letter) and a bunch
of space for each one. It will probably
You want to use a source filter. The source filter is a Perl module that
filters the module before it is run, so it could be used to show/hide
debugging info, or in your case decrypt it. The Perl Journal had a good
article on it a while ago, check it out and then see what pre-built filters
are a
If all you want to do is download the file, try this...
# Tested
use LWP::Simple;
my $localfile = 'myfile.pdf';
my $remotefile =
'http://historychannel.aestaging.com/egypt/EgyptTeacherGuide.pdf';
open OUT, "> $localfile";
binmode OUT;
print OUT get($remotefile);
close OUT;
Rob
-Original
You don't even need a regex although you could use one...
# untested
my $num = 92739874598745;
$num =~ /^(\d*)(d{4})(\d{5})$/;
my ($n1, $n2, $n3) = ($1, $2, $3);
Or you could do this...
# untested
my $num = 92739874598745;
my $n1 = substr($num, 0, length($num) - 9);
my $n2 = substr($num, -9, 4