Re: Displaycode suggestion
by theorbtwo (Prior) on Nov 25, 2004 at 18:27 UTC
|
I like the idea -- I'm just not sure what the name should be... the name of the node with .pl appended, the nodeid with .pl appended, a cleanup of the node name...
# $NODE is a common feature throughout the codebase, please, don't com
+plaign about that element of my style.
my $filename = $NODE->{title};
$filename =~ s/[^A-Za-z0-9.-]/_/g;
$filename =~ s/__+/_/g;
$filename .= '.pl';
, perhaps?
Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).
| [reply] [d/l] |
|
|
| [reply] |
|
|
nodeid.pl ROCKS ... and incidentally, makes easy to find ones way back to the source.
| [reply] |
|
|
$filename =~ s/__+/_/g;
$filename =~ y/_//s;
| [reply] [d/l] [select] |
|
|
| [reply] |
Re: Displaycode suggestion
by theorbtwo (Prior) on Nov 26, 2004 at 11:44 UTC
|
Done. We now send a Content-Disposition: inline; filename="NNNN.pl" header. (Note that IE will try to save to NNNN_pl.txt if you do not have an association set up, or ignore the inline bit and try to save immediately if you do not. I think we have to agree to live with that.) Thanks for the suggestion, Original Anonymonk.
Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).
| [reply] [d/l] |
|
|
| [reply] |
|
|
Wow that was fast :). Cool! :)
By the way, do you maintain a dev/acc/production separate environments or do the changes to code go in right away?
| [reply] |
|
|
| [reply] |
Re: Displaycode suggestion
by ww (Archbishop) on Nov 25, 2004 at 18:04 UTC
|
| [reply] |