Re: 2 off in array count and index

2010-03-22 Thread Jay Savage
On Tue, Mar 16, 2010 at 11:47 AM, jbl wrote: > I am reading a directory and creating an array of .png file names. I > know for a fact that there are 1025 png files in the folder > With $count = @files I get 1027 > With $last = $#files I get 1026 > $files [0] = . > $files[1] = .. > I have heard of

Re: CGI ap on NetworkSolutions host

2009-04-08 Thread Jay Savage
u. Also make sure that the permissions comply with whatever the site's security policy is. Many servers won't execute scripts that are world-readable, for instance. HTH, -- jay -- This email and attachment(s): [ ] blogable; [ x ] ask first

Re: Send a file

2008-02-19 Thread Jay Savage
output. See perldoc -f print for more detail. You probably want something like print while (<$fh>); You could also store the file to an array first, or "slurp" the file, if you want to eliminate the loop. HTH, --jay -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: FLOCK

2007-05-29 Thread Jay Savage
server approach where all writes are dispatched to a single writer process that serializes the write requests before committing them to disk. HTH, -- jay -- This email and attachment(s): [ ] blogable; [ x ] ask first; [ ] private and confidential d

Re: figuring out if a number/character string is null in Perl

2006-09-01 Thread Jay Savage
to optimize your code; Perl does it for you. Once more, just so we're clear on this: This isn't C, you don't need to worry about code optimization. Relax; don't worry; have a homebrew. Personally I wish I had learned Java or PHP but I don't have the time right now

Re: How to do a static variable that persists from page to page

2006-05-02 Thread Jay Savage
7;s going to do. How proactive you have to be vs. how reactive you have the luxury to be will depend mostly on your hardware, and also whether you're using mod_perl, FastCGI, etc.. The faster you can turn around database and HTTP requests as they come in, the less important caching and pref

Re: How to do a static variable that persists from page to page

2006-04-28 Thread Jay Savage
On 4/28/06, Mary Anderson <[EMAIL PROTECTED]> wrote: >Hu Jay, Thanks for the reply. There is a lot I don't know to chew on. Could you just clue me in on a few things: DATA::Dumper must be a perl module on CPAN? POST and GET are elementary CGI commands that I had bet

Re: How to do a static variable that persists from page to page

2006-04-28 Thread Jay Savage
he cached queries keyed by a unique id for each session in BDB or something. then just pass the session id as a hidden field. There are lots of options here. If your goal here is just to allow scrolling and you're not doing anything else with the form, though, it may be ti

Re: C++ query with mySQL

2006-04-10 Thread Jay Savage
of Get. Failing that, check the return value. You should really be taint checking anyway, so modifying the regex shouldn't be too hard. In your action form, just do the opposite, more or less, of what you do in your post form. If it starts with 'C_and_C', you know i

Re: Matching a string containing '+'

2006-02-08 Thread Jay Savage
error message shows--the error is being propagated from MySQL's REGEXP operator. MySQL uses POSIX re, not Perl re or even PCRE. The differences may be significant. If Clarkson's recommendation doesn't fix the problem, you'll probably want to talk to a MySQL list. The

Re: regex nth match of string, perl 5.8.5

2006-01-23 Thread Jay Savage
u were assigning to a variable instead of performing a substitution. You also don't seem to actually increment count anywhere. Try something more like my $count = 0 ; s/\/ sub { $count++; my $return; if ($count == 2) {

Re: implementing links on a system command output

2005-10-14 Thread Jay Savage
g this either. Is your question about getting CGI.pm to generate dynamic content based on system command output? Or is your question simply how to declutter a page full of radio buttons? Or is your question something else entirely? Whichever it is, giving some specific code you're having troubl

Re: Script execution time.

2005-08-03 Thread Jay Savage
g for all kinds of trouble. The best way to benchmark queries is from the command line, or phpmyAdmin, which is designed for this. You can also use MySQL Administrator and the Query Browser for this (I think). In any case, you're looking for an application, not a feature of the programming la

Re: Control structures

2005-01-21 Thread Jay
On Fri, 21 Jan 2005 18:03:29 -0500, Jay <[EMAIL PROTECTED]> wrote: > On Fri, 21 Jan 2005 17:56:17 -0500, Jay <[EMAIL PROTECTED]> wrote: > > On Fri, 21 Jan 2005 19:20:44 +, Mark Martin <[EMAIL PROTECTED]> wrote: > > > Hi , > > > I'm getting c

Re: Database Rows Returned

2005-01-05 Thread Jay
y each time. If a row is added before the current page, the first item on the page will be a repeat of something the user has already seen. Probably, this won't be an issue for you. If you need to make sure the user sees the info as it was at the time they made the request, you'll need t

Re: Simple table question?

2005-01-03 Thread Jay
p {"$_ "} @row, "\n" # or: # print "", map {defined $_ ? "$_ " : "(null)"} @row, "\n" ; } print "\n" ; HTH, --jay -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>