Hi,
Chris Brown wrote:
> i have read about it in 3 books and even used it in scripts i have
> made but i still dont truly know how to be sure what $_ contains...
> can anyone clear this up for me? Thanks
Interesting question, which can be answered in a multitude of ways. The
long and the s
>
> Are there performance implications for using the implicit variable ($_) rather
> than declaring a specific variable? If so how great ?
Yes, though very minimal performance hit if anything.
Consider the following:
while (chomp(my $line = )) { ... }
vs.
while ()( ... }
According to an exc
The perl documentation (perldoc -f my) has this to say about the perl
builtin "my":
A my declares the listed variables to be local (lexically) to the
enclosing block, file, or eval. If more than one value is listed, the
list must be placed in parentheses. See Private Variables via my()
hi,
here's a regex that matches what you're after:
$filename =~ m/\/(File-[^\/]+)/;
$part_you_want = $1;
Simply using negation to match "File-" (and anything which is not a "/")
which is preceeded by a "/", is what you want. The trailing / is
optional.
File::Basename is used to separate the f
Hi,
The error message you're getting is one of the many changes to the
nature of perl under strict. It usually means that the variable in
question needs to be either explicitely named (via
$::Package::Variable) or lexically scoped (via my, our, or use vars).
you've made a couple errors here, w
If you're talking about using a database (such as mysql) to store images
for later display/perusal on a web page, I believe I can offer a bit of
aid.
First - it's a bad idea. Databases add a number of layers of overhead
for the access of BLOB data as opposed to the filesystem of whatever OS
you'
There are many ways to do it, here's mine:
I wanted to semi-securely identify users to my site, having them log in
once, and then never have the need to login again (as long as they're at the
same computer)
So, I used cookies (perldoc CGI) to set a unique session ID, once a user
had logged in.
Cookies are set in the HTTP header portion of the HTML response. When you
run you include your script within the page, the HTTP header has already
been sent.
You need to set the cookie as a standalone page (though you can get cookies
in included scripts)
--A
-Original Message-
From: