Hi Folks,
I have 2 perl scripts and I need to execute 2nd perl script from the 1st perl script in WINDOWS.
In the 1st perl script that I had, I am calling the 2nd script
main.pl
===========
print "This is my main script\n";
`perl C:\\Users\\sripathg\\Desktop\\scripts\\hi.pl`;
hi.pl ( this script I am calling from the firstperlscript.pl)
====
#!perl -w
print "hii Gir
In the Perl documentation, perlrun(1) suggests launching Perl scripts using a bilingual shell/Perl header:
#!/bin/sh
#! -*-perl-*-
eval 'exec perl -x -wS $0 ${1+"$@"}'
if 0;
What does ${1+"$@"} mean? I tried using "$@" instead (using Bash as /bin/sh), and it seems to work just as well.
Edit
Two answers below say that it's supposed to be ${1:+"$@"}.
I am writing a perl code(windows) to traceroute IP address and to print the output.
I had executed the below code which was taken from cpan modules
Code:
#!C:/perl/bin/perl.exe
use Net::Traceroute;
$tr = Net::Traceroute->new(host=> "google.com");
if($tr->found) {
my $hops = $tr->hops;
if($hops > 1) {
print "Router was " .
$tr->hop_query_host($tr->hops
libcdt4 libcommon-sense-perl libencode-locale-perl libextutils-depends-perl libextutils-pkgconfig-perl libfile-listing-perl libfile-which-perl libfont-afm-perl libgnome2-0 libgnome2-canvas-perl libgnome2-gconf-perl libgnome2-perl libgnome2-vfs-perl libgnome2-wnck-perl libgnomecanvas2-0 libgnomecanvas2-common libgnomeui-0 libgnomeui-common libgoo-canvas-perl libgoocanvas-common libgoocanvas3 libgra
I want to call a perl script inside a mysql after insert trigger.
but my trigger does not work.I find this solution from google.
here is my code:
DROP TRIGGER IF EXISTS 'tr1'//
CREATE TRIGGER 'tr1' AFTER INSERT ON 'username'
FOR EACH ROW begin
SET @result=sys_exec(CONCAT('/usr/bin/perl /etc/p1.pl'));
end
//
and my p1.pl code:
#!/usr/bin/perl
open(MYFILE,'>>/etc/data.txt');
print MY
I am a novice writing perl scripts so I'd appreciate any help you guys can offer.
I have a list of 100 words in a file (words.txt) and I need to find them in a second file (data.txt). Whenever one of these words is found I need to write that line to a third file (out.txt) and then continue searching for more matches.
Hello there,
I have a security question.
All we disable some dangerous function in PHP ti avoid running of PHP shells. As cPanel uses perl for all its tasks and al of PHP's dangeros functions have equivalents in perl, so someone can easily port a pho shell to perl and simply run it on the server. Disabling any function in perl will result in cPanel's many parts to stop working.
My Linux Platform: CentOS 5.8
Install Package: perl-PDF-API2
I downloaded the tpm package from the link below:
http://pkgs.org/centos-5-rhel-5/flexbox-i386/perl-PDF-API2-2.019-1.noarc...
I get a warning of Failed dependencies when running rpm install command
# rpm -Uvh perl-PDF-API2-2.019-1.noarch.rpm
warning: perl-PDF-API2-2.019-1.noarch.rpm: Header V3 DSA signature: NOKEY, key I
can someone help me translate the following command, from:
Code:
/usr/bin/awk "/^$TOFDAYM $TOFDAYD /,0" $LOGFILE
to something like
Code:
perl -e .....
basically, i want to use perl to do awk functions within a shell script. i want to do the above awk, using perl.
any suggestions?