My main concern was that the script would die from SIGALARM. I'm testing on
and XP box and using the script on a FreeBSD box. How can I get the cron
function on my XP box?
Also I have to get admin permission for cron jobs. Which I don't think will
be a problem.
It's not important that th
Hi all,
I'm writing a script which fetches data every hour. I thought instead of
using cron which is platform dependent, to use sleep and a goto statement. Is
there any downfalls to this?
At the start of the script I check to see if it was ran in the previous hour.
BEGINNING:
if(open(TIMECHEC
length() Returns the length in characters. How do I translate that to bytes?
Is there a function to get the buffer size?
Hi everyone,
Does perl have a function to get the buffer size of a string?
Thanks,
Tricia
I get an unknown error from the command prompt.
My goal was to fetch a list of numbers for the socket port.
Maybe it's just an XP problem ??
#!perl -w
my$hostprog = 'localhost';
if(open(LOG, ">>./log.txt")){
}else{print "Couldn't open LOG";}
use IO::Socket;
use LWP::Simple;
#get a list of socket n
Hi all,
Is there a way to get the path of the script that called the current script
from the interpeter instead of from the HTTP_REFERER variable?
Thanks
Tricia
Thanks everyone,
The reason the BEGIN statement was there is I don't exactly know where my
error logs are and it's faster to just read the file. Plus if it wasn't a
script problem the err.txt file wouldn't be created.
I'm not clear about why the script could function from the shell and not
#!/usr/bin/perl -w
use strict;
BEGIN{open(STDERR, ">./err.txt")}
print "Content-Type: text/html\n\n";
foreach my $key (sort keys %ENV) {
print "\$ENV{$key} = $ENV{$key}\n";
}
None of my scripts are functioning on my new server. The BEGIN statement
doesn't write err.txt
But it does function
I'm running out of web space and want to write a script that tell me the size
of certain directories so I can see where the hog is.
Can anyone give me some quick code?
Hi everyone,
I'm trying to send info with (https) SSL and my program comes to a halt when
writing a file and sending an email.
SSL was set up by my hosting service with an unauthenticated certificate that
I had them set up for demo purposes. Does this have something to do with it?
Or is it a
In a message dated 11/26/03 6:28:54 AM Pacific Standard Time,
[EMAIL PROTECTED] writes:
BTW we'd all /really/ like to know who you are. This isn't a
costume party :)
I'm not sure what you meant by the above statement Rob. I'm guessing it goes
with your signature.
I think I will try GD. Is it
I've tried to install image magic on my server a couple years ago, but found
out it wasn't necessary for my project. But now I may need it. All I want
to do is slice an image and add it to a database. It has to be executed
automaticall from a script.
Thanks
This is my first attempt. My misunderstanding was in the fact that I could
put the filehandles inside another filehandles while loop.
#!perl
use strict;
&read_the_files;
sub read_the_files{
print "\nread_the_files";#
my$file1 ="./file1.txt";
#contents of file1.txt
#1
#6
my$file2 = "./f
Hashes are for referencing by a key name. There isn't a need for a hash if
you're using a number index.
I have some large files that all have data for filling one table. I'm
concerned about memory resources.
1. I want to read from each of these files one line at a time at the same
time without assigning the file to an array.
I haven't done this one yet, Does anyone have any example code? I wa
I use editpadpro, (there is a lite free version of it). You can download
syntax color schemes for perl code. It will give you the matching brace or
parenthesis.
http://www.editpadpro.com/cscs.html
Hi all,
Is there an easy way to sort 2 arrays and keep the relating indices together.
for instance I have an array of times, and an array of emails.
I would like to give the user a choice of sorting by time(numeral) or
email(alpabetical);
[EMAIL PROTECTED] = ();
for(my$i=0;$i<@open_pages;$i++){
while ()
{
if (/QUIT/)
{ last; }
push @thestack, $temp;
}
The only solutions I've discovered is:
( for less secure tables)
1. Crypt the password
2. Put it into directory not in the public domain
3. Set the permissions set only for your scripts.
( for more secure tables)
1. I would gather sensitive info last if possible.
2. Do not put the password on
I'm new to databasing too, and decided to put this question off till I got
the basics down first.
My beginners solution was to put the database info in a txt file in my
cgi-bin and read the variables into the script. I also set the variables for the
info with this code, which I read hides the
In a message dated 8/13/03 8:59:58 AM Pacific Daylight Time,
[EMAIL PROTECTED] writes:
Thanks, I had wonderful documentation program with perl 5.6.
But when I updated to 5.8 with mod_perl php and apache (after formatting my
disc because of a virus) I lost the documentation program, and nothi
Is this for tracking user id from page to page, If so I have some javascript
that automatically add the tracking number to all forms and links.
I've been reading the previous post and was wondering about what qr does in
this code.
use strict;
use warnings;
my @array = (
qr'^to: myprog'mi,
qr'^from: [EMAIL PROTECTED]'mi
);
my $str = 'To: myprog with trailing text';
foreach (@array) {
print "found\n" if $str =~ $_
Have you read the ebook beginning perl?
I downloaded it but I don't have the url. Sorry.
Try google with 'ebook beginning perl'
Sorry for not contacting you first. I'm still new compared to most with web
manners and programming in general.
I've searched with search engines and asked in the forums and couldn't find
the link to the book. I just gave up and created my own link.
Thankyou for making this book freely availa
In a message dated 8/13/03 9:46:29 AM Pacific Daylight Time,
[EMAIL PROTECTED] writes:
I see, you have no control of over the redirect. Use the IP address first
and if it returns no match check for cookies. If the cookie returns nothing
then create an popup input box with javascript.
Yes an
I've posted the ebook Beginning Perl for downloading at:
http://websiteprogrammin.com/wsp/docs/Beginning_Perl.zip";>http://websiteprogrammin.com/wsp/docs/Beginning_Perl.zip
Yes, that's where I got it from, but I have asked a couple of times in the
forums here and searched for it with search engines with no luck. So I just
decided to upload it.
http://learn.perl.org/library/beginning_perl/";>http://learn.perl.org/library/beginning_perl/
It took a couple hours to
Hi all,
I have downloaded and installed perl with apache and php
Here are the readme file folders for each part of the packaged file
Perl-5.8-win32-bin-0.1.exe
openssl-0.9.6h
php-4.23
mod_perl-2.0
httpd-2.0.43
AP804_source
I have apache running ok and perl, but I can't get the hello world fil
I'm learning on a win98 machine and my webserver is a unix OS.
win98 doesn't support flock and of course unix does.
How can I code to test if the function is supported? I tried conditionals
but it still throws the error.
Hi everyone,
I'm getting this warning: Possible unintended interpolation of @pkg::array1
in string
What does it mean and how do I fix it?
Do I need to change the http header for transfering image urls? I get errors
when I transfer a jpg:
picture cannot be displayed because it contains errors.
I'm curious if it's possible to make a web page that controls:
1. testing to see if a socket is available
2. if not searching for another socket #
3. use html buttons to open and close sockets.
Does anyone have an example of this?
I'm getting this error on my unix server from my socket script. The script
does fine on my localhost win98 box. What does Illegal Seek mean?
I have a script that opens a socket on my web server. The script doesn't
close the socket. I opened the socket yesterday. When signing back on today the
socket was closed and my scripts returns an error.
How do I keep a socket open indefinately?
In a message dated 6/16/03 11:35:03 AM Pacific Daylight Time,
[EMAIL PROTECTED] writes:
> >I tried a couple of those ideas.
> >
> >I put a BEGIN statement in the script I'm trying to open and
> >to my surprise
> >it's opened. I'm still getting Error: No such file or directory
> >
> >The scrip
I tried a couple of those ideas.
I put a BEGIN statement in the script I'm trying to open and to my surprise
it's opened. I'm still getting Error: No such file or directory
The script is very small and on a unix platform:
#!/usr/bin/perl
use CGI;
my$q = CGI::new();
print $q->header();
print "
I'm trying to execute a perl script with
system("sendscript.pl");
I also tried exec("sendscript.pl");
Both of these return Error: No such file or directory
The sendscript.pl is in the same directory as the script.
What am I doing wrong?
My script uses Sendmail. And I was just wondering about the question that is
in todays topics, How to pack the mail module with your project.
Do all servers with perl 5 and above come with Mail::Sendmail? Should I put
Mail::Send in my programs library of odds n ends and use it instead?
In a message dated 6/2/03 10:10:40 AM Pacific Daylight Time,
[EMAIL PROTECTED] writes:
> -T
> Thanks, I will put this post in my notes
I use a BEGIN{open(STDERR, "./error.txt"} in my script to track errors and trace variables etc. But I think a friend has pointed the error out to me. I'm checking now.
--- Begin Message ---
I use a BEGIN{open(STDERR, "./error.txt"} in my script to track errors and trace variables etc. But I think
I am new to marketing. I know how to sell on ebay and that's about it. I
don't know how to protect myself with legal jargon. Can anyone point me in the
right direction?
I've written a script that installs a Flash file on the users server using
LWP and gathers info for the text files that the
Also I should mention that I create another cgi object for a diferent file
that is out of scope and not related to this method. Does that matter?
This is really strange. I have a method that works and returns all the
values in a file for the cgi object. But on the second call to the script it opens
the file and returns none of the cgi parameters.
the $cgi->param( ) returns POSTDATA
and the keywords( ) returns nothing.
I'm using strict
In my program I have a place where people can put descriptions with images.
And I'm wondering about special characters in other languages. What should I
allow for the description field. And my keyboard doesn't have the exclamation
over the letter and the ~ over the n thing. How do I allow for
I'm having the same header problem as the mark.
I removed all the headers and the script still functions, but it doesn't
print the cookie header. There is a module for deleting previous headers but I
can't remember what it's called.
#!C:/Perl/bin/perl.exe
BEGIN{open(STDERR, ">./errors/order.
I'm afraid to use `ls -al` now because unix sytems may vary.
I'm going to try the module suggested:
http://search.cpan.org/author/MJD/Stat-lsMode-0.50
and insert the $^O to test for windows or unix.
Then to test for windows permissions I can just use -r and -w, right?
Somehow I would have to
http://www.rubycentral.com/book/ref_c_file__stat.html
Ive read the above page which explains File::Stat methods. I'm just not sure
how this translates to the various unix forms of drwxrwxrwx.
Another thing I'm not clear on is the real user and the effective user.
I've read about 10 pages on unix permissions.
So far I've learned that a directory is a file with a listing of
subdirectories and files. And the d in drwxr-xr-x indicates the file is a
directory. And if it begins with -, it's a file -rwxr-xr-x.Also the -
separates permissions of the Ow
I've learned alot from all this. Thanks for the info!
This is what I pulled from the learning perl book.
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$b
locks) = stat(...)
I tried this to access the mode but it puts out a number 16877 that I don't
konw how to de
I'm trying to put the string from the system("ls -al") into a variable. It
simply prints to the page and puts 1 in the variable.
I wan't to use this variable to determine the permissions for the files on a
linux machine. Is there an easier way?
Tricia
Does windows use the chmod command in the same manner as unix
I'm writing a file browser script. I've learned about chmod and unix
permission numbers and what they represent. But how do I determine the
owner, group and other permission settings.
Is there a perl module that makes this chore easy?
Thanks
Tricia
Need instruction & not sure where to get it.
I have downloaded apache and perl. I just partitioned my hard drive with
partition magic, and now have 3 os systems on one computer. Win98, Win95,
and Linux. And want to install Win2000 soon.
What I want to know is do I have to put Active perl
I just parked a domain name a few days ago and now I want to use it. But I
can't seem to access it with the $ENV variables.
I've tried
$ENV{'SERVER_NAME'}
Which I thought would do the trick!
Anyone have any tricks up their sleeve?
Thanks
Tricia
I installed the perlfect search on two sites. And I need to write a script
so they can be indexed from an html form or link. Can Scripts run other
scripts by sending a link to that file? In other words can I make the
script indexer.pl run from a link.
My new web hosting service at oneononeinternet.com doesn't have error logs
for each site. What do I do?
Is there a way for me to create my own logs for my perl files?
That did the trick thankyou!
I was reading and came across this code:
I put the contents of Image-Size-2.98 under the Image directory.
use lib qw(/home/yrkylady/www/cgi-bin/perl/Image);
eval("use Image::Size 2.98;");
(print("Error: $@"), exit(-1)) if $@;
And when I try to open my file I get this error:
Error: Can't locate
I want to use Image::Size on my site but my Server doesn't have it installed.
I've been waiting for them to install it.
##
But the reply I recieved from them was :
Could you please explain in detail regarding the module Image::Size, I am
little bit confused about the p
Hi everyone,
I'm writing a CGI program that requires that I discover the dimensions of an
image that a person uploads. Can perl or javascript do that?
Thanks
Tricia
Can I read cookies, (written from a javascript located outside the cgi-bin),
with a perl file located inside the cgi-bin?
Hi,
I have a javascript program that makes cookies from outside the cgi-bin.
I want to access those cookies from a perl file within the cgi-bin.
Cookies are a new subject to me and this is the code I've learned so far in
making cookies.
#!/usr/bin/perl -w
# ic_cookies - sample CGI script that u
Could someone tell me why this doesn't retrieve my cookie?
The cookie has already been set by another page and I just want to retrieve
it.
#!/usr/bin/perl
use CGI param, header,cookie;
print header();
print header(-cookie=>'MY_COOKIE');
Sorry ,
I have been programming all night and found an oversight on my part.
Perl reported and error in a sub routine, but the error was above the
routine
above some of my comment lines where I didn't expect it to be.
That was part of html code that was out of place.
Live and learn I gue
My program won't compile when the sub routine is in the program,
but when I remove it from the program and put it into another file
that I call test.pl, and compile test.pl which contains only the sub
routine I'm checking, it compiles fine!
Why does it do that?
I was happily programming, getting close to the end of my project just trying
to figure out table placement in html within my largest function on the page.
All of a sudden my function won't function! I didn't change any of the perl
code! And it was fine except for table placement! Well, I r
In a message dated 1/28/02 1:16:55 AM Pacific Standard Time,
[EMAIL PROTECTED] writes:
>
I have a sub routine that I use for making all numbers calculate to two
decimals places which I use for calculating money values.
I will place it on my website.
The site is new and only displays well in
69 matches
Mail list logo