Dark Reaper,
NOTE for inexperienced programmers:
This thread uses symbolic references. Symbolic references are frowned upon by many programmers. Inexperienced programmers should avoid the use of symbolic references.
It would be faster to call dehash with a reference:
dehash( $hit[1] );
sub...
Try this one. It is written by a programmer, but it is clear and teaches secure CGI programming practices.
http://www.easystreet.com/~ovid/cgi_course/index.html
HTH,
Charles
Rob,
You haven't loaded CGI.pm:
#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;
use CGI::Carp 'fatalsToBrowser';
$req = new CGI;
Should be:
#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;
use CGI::Carp 'fatalsToBrowser';
use CGI;
$req = new CGI;
Do you have a...
Rob,
I didn't mean to make you feel dumb. Please remember that many of us were new to programming at one time. The subroutines can go anywhere you want, but are traditionally placed at the end of the program below the last line of code in the main program.
HTH,
Charles
Rob,
This is the second time you have listed the source without the subroutines. Did you put the two sub routines in your program? If you were using strict you would have caught this error immediately!
Here are the subs again:
sub artist_table {
#
# $name the artists name...
Rob,
First, a point on security. Never post actual file paths to a public forum. Change them to something innocuous like: data.log.
Second, start all your web scripts with:
#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;
use CGI::Carp 'fatalsToBrowser';
If use warnings gives an...
It sounds like you need a hash. A hash is like an array but the indexes can be names and you an't count on the order. Before we go much farther let me show a shortcut to getting information from the file.
Since we only need $id, $artist, and $title,
($id, $simage, $bimage,
$artist...
Neversleep, it fails on 'Hello'. Or any odd length string.
How about something with customisable grouping?
print group_reverse( 'How are you?', 2 );
sub group_reverse {
# reverse a string by character grouping
# omit or set second argument to 0 to reverse entire string.
# group_reverse(...
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.