IS it possible to create context sensitive functions?
Ie. The function returns different results depending on what context it's called?
my @array =someFunction();
my $scalar =someFunction();
If the function is called in array context I want to return an array, but if it's called in scalar...
I'm having trouble comparing 2 binary files, can anyone give me a pointer to what I'm doing wrong in the following function:
private function filesSame(FileName1, FileName2)
Const adTypeBinary = 1
'Create Stream objects
Dim BinaryStream1, BinaryStream2
Set BinaryStream1 =...
I keep getting strange errors when using PerlScript (on Windows 2000 with IIS).
After an indeterminate period of scripts working just fine they start to fail with strange errors messages such as:
500 Can't locate object method "configure" via package "Net::HTTP" (perhaps you forgot to load...
I'm trying to perform a select that orders the results alphabetically yet always puts a specific one last.
Ie.
Fred, Jane, Sharon, Tracy, Bill
I always want Bill to be last even though the rest are in alphabetical order.
Any help would be greatly appreciated.
Something along the lines of...
I know I'm doing something wrong but could anyone point me to what it is. I'm trying to get the size attributes from a .gif using the code shown below (I think it's something to do with how I'm passing $imageData into imgsize):
use HTTP::Request;
use LWP::UserAgent;
use Image::Size;
my $ua =...
Hello,
This should be a pretty easy one for most peeps, I'm hoping someone can help me here. I'm trying to extract a list of urls from a string.
Remembering that urls could be typed "http://blahblah.com" or "www.blahblah.com".
Here is what I have so far.
my @links = $textString =~...
Hi everyone,
I have a CGI script which performs a fair bit of work and I want to stop it running if the user closes their browser or hits back etc.
It's pretty easy in asp, as I could use Response.isClientConnected
Take a look at the following code:
print "Content-Type: text/html\n\n"...
I have a script that fetches a list of active articles into an array and it is working fine.
use Net::NNTP;
my $nntp= Net::NNTP->new($newsServer, Timeout => 60, Debug => 0);
$nntp->group($group);
my $listPointer=$nntp->listgroup();
This code fetches ALOT of articles in many cases and what...
Hey everyone,
Does anyone know how to check if a filehandle is currently open for writing (or open for that matter) see below:
$SIG{'INT'} = 'SIGNALHANDLER';
open FILE, ">/somefile";
# Some one presses Ctrl C here!
close FILE;
# Some one may press Ctrl C here!
sub SIGNAL HANDLER {...
I'm sending emails with Mime::Lite using SMTP and I cannot find a way to use "Real Names" as shown below for my From field.
"Keith Boynton" <keithboynton@somewhere.com>
Should be perfectly valid?
Yet using Mime::Lite it doesn't work, I think where it actually falls over is in the function...
I am having some problems with the XML::Parser module. It is returning an error when passed some valid xml in the form of a string. The error it returns is:
No element found at line 1, column 0 byte -1
This seems to suggest that the string is empty although if I print the string immediately...
Hi has anybody had any success compiling Perl on either Win32 or Unix?
I have tried Perl2Exe without any success, I think it can only compile REALLY simple scripts.
Any suggestions?
I have a script that sends a .gif to a requesting webpage. It works fine when the script resides on a unix server but when the script sits on a windows server the .gif is garbled.
Here is the script:
print "Content-type: image/gif\n\n";
open(INGIF, "$image")...
i have the following select element:<br><br><select name="AvailableLists" size="10" onClick="updateDescription(this.form)"><br><option value="1">General</option><br><option value="2">Discworld</option><br><option...
i have a page that lets a member edit their information, the new details are posted form a form to a process .asp script when inserts the new details into a database then redirects the page back to the edit form.<br><br>both the edit page and the process page both have response.expires=0 so the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.