|
I've been Googling and Overflowing for a bit and couldn't find anything usable.
I need a script that monitors a public folder and triggers on new file creation and then moves the files to a private location.
I have a samba shared folder /exam/ple/ on ...
Started by CheeseConQueso on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Files) { # Move file move("$dirname/$target", "$dest_dir/$target"); # Trigger external Perl script than incron due to pyinotify is pure Python event-driven -- less impact than the perl script autocmd.py something like this....
|
|
I have a Perl script that is getting big, so I want to break it out into multiple scripts. namely, I want to take out some large hash declarations and put them into another file. How do I get the original script to be able to see and use the variables...
Started by john on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
If not (perhaps, it has limited....
= ( Batman => "Robin", Bert => "Ernie", Don => "Sancho", ); 1;
For example:
#! /usr/bin/perl to get this installed into either your site library (usually under ...(perl install folder)...\site\lib .
|
|
I've got a Perl script that needs to execute another Perl script. This second script can be executed directly on the command line, but I need to execute it from within my first program. I'll need to pass it a few parameters that would normally be passed...
Started by cbowns on
, 9 posts
by 9 people.
Answer Snippets (Read the full thread at stackoverflow):
If you need to asynchronously call your external script -you just want to launch it and not wait another script and terminate ....
#!/usr/bin/perl use strict; open(OUTPUT, "date|") or die "Failed to create.
Easiest and most likely.
|
Ask your Facebook Friends
|
I have a plain perl script that can be run from the command-line via perl -w test.pl . I then have a mod_perl2 script that can be accessed from a web browser. I want to have the latter call the former and send the output to the browser, flushing as it...
Started by Kev on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
You need to find where Perl binary lives (on Unix, do which perl , on Windows, find Perl icond and find command line path or find the directory where perl is installed....
This is to put a "1;" at the end of your script.
|
|
Is it possible to run Perl script (vas.pl) with shell sript inside (date.sh & backlog.sh) in cron or vice versa? Thanks.
0 19 * * * /opt/perl/bin/perl /reports/daily/scripts/vas_rpt/vasCIO.pl 2> /reports/daily/scripts/vas_rpt/vasCIO.err
Error encountered...
Started by Cez on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Cron runs your perl script:
# I'm assuming your shell script reside in the same # dir as your perl script: system("sh /reports in a different working directory....
Consider fully qualifying the path to your .shes.
Passwd file.
|
|
G'day,
We have a Perl script that is processing geolocation requests from the head-end servers in a major web site. The script is a broker providing additional business logic interpreting the data returned by a COTS product that provides data for a given...
Started by Rob Wells on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
I guess....
This way, any call to that API can in turn decide what needs to be done the added benefit of allowing you to re-design the config later on (perl has => xml => Database of abstraction above the config.
Read from a Perl hash.
|
|
I need to port my Perl log handling script to Python. Here is a simple example of a Perl script I can use:
#!/usr/local/bin/perl $|=1; # Use unbuffered output while(<>) { system("beep"); }
As you can probably see, I am telling the system to beep...
Started by Cory Walker on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at serverfault):
#!/usr/bin/python import sys while 1: line....
Last time I hacked something in python to read stdin as a pipe my code looked like this .
Where are you getting beep from? Have you tried putting in the full path to this beep command?
Edited to add code sample .
|
|
I have a simple Perl script which runs as a Linux daemon using an infinite loop. It connects to a database every 10 seconds to execute a process.
while (1) { # THIS LINE WILL KILL THE SCRIPT IF IT FAILS my $DB=DBI->connect("dbi:Sybase:server=myserver...
Answer Snippets (Read the full thread at stackoverflow):
While (1) { # THIS LINE WILL KILL THE SCRIPT IF IT FAILS my $DB; eval { $DB = DBI->connect("dbi with $DB continue { sleep 10; } }
See also Object Oriented Exception Handling in Perl, is it worth it? and How can I cleanly handle error....
|
|
I am trying to print a XML file in the browser using a perl script. While I am trying to run the script in my browser I am having the following error.
Server error! The server encountered an internal error and was unable to complete your request. Error...
Started by Babu on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
However, if an id other than 7007 is specified, I get a 500 result because the script completes....
It may or may not be Perl-related - one common case is that the server is not set and the Perl works fine.
For the actual error message.
|
|
People also often ask "How can I compile Perl?" while what they really want is to create an executable that can run on machines even if they don't have Perl installed.
There are several solutions, I know of:
perl2exe of IndigoStar It is commercial. I ...
Started by szabgab on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
In addition and works differently from the typical....
I've also found both perl2exe and Active State's Perl Dev kit useful for shipping Perl applications.
You could use the perlcc tool that's shipped with most distributions of Perl.
|