Hi all,
I have the following snippet of code..
#!/bin/sh
echo "run perl script............"
#Run the verification script
perl bill_ver
echo " perl script completed....."
echo "rename files......"
#Remove from all file in the directories test, test1, test2, test3
for f in... (3 Replies)
hi,,
i have perl scipt with line :
system('./try.sh $t $d $m');
in shell scipt try.sh i have the line:
echo $1
its not printing value of $t that i hav passed..y is it so..i am running it from apache web server (2 Replies)
Novice to perl here.
I have created a simple web page in perl, with only one submit button. I would like to execute a bash script on the same server when this button is clicked on.
Is this possible in perl? I have spent a few days researching this and am unable to find any useful information.... (0 Replies)
Hi
I m new to perl. I m trying to write a perl script that calls a bash script; does anyone have a script already that they can provide or help me out? Thanks a lot. (2 Replies)
I have a Perl script sub.pl, and i want to call another Expect script called sub.exp. The sub.exp will generate a text file called sub.txt, while the sub.pl called from a html form will display the content of sub.txt to the textarea on the html form. How do I call sub.exp from sub.pl???
... (5 Replies)
Ok, don't ask me why, but all calls to perl must be called by a shell script. Its really not ideal, but its what I have to work with.
Calling it isnt the issue, its passing in the arguments.
I have about 1000 perl scripts to call by a shell script. Right now, I'm executing the shell script... (3 Replies)
Hi. I wanted to create a Perl script which can take the outputs of a Perl script as it's input and temporarily store them in a document. Need help.
Thanks.:) (8 Replies)
Hello Gurus
Can anyone please let me know how to call .profle file in perl script
When I am calling the .profile file its giving error
Shall I create unix script which has .profile command and call perl script internally (2 Replies)
I'm attempting to write a bash script that will create a network between virtual machines. It accepts three arguments: an RSpec that describes the network topology, and two list of machines (servers and clients).
I have a (working) Perl script that I want to call. This Perl script takes an RSpec... (6 Replies)
Discussion started by: mecaka
6 Replies
LEARN ABOUT MOJAVE
universal::require5.18
UNIVERSAL::require(3) User Contributed Perl Documentation UNIVERSAL::require(3)NAME
UNIVERSAL::require - require() modules from a variable
SYNOPSIS
# This only needs to be said once in your program.
require UNIVERSAL::require;
# Same as "require Some::Module"
my $module = 'Some::Module';
$module->require or die $@;
# Same as "use Some::Module"
BEGIN { $module->use or die $@ }
DESCRIPTION
If you've ever had to do this...
eval "require $module";
to get around the bareword caveats on require(), this module is for you. It creates a universal require() class method that will work with
every Perl module and its secure. So instead of doing some arcane eval() work, you can do this:
$module->require;
It doesn't save you much typing, but it'll make alot more sense to someone who's not a ninth level Perl acolyte.
Methods
require
my $return_val = $module->require or die $@;
my $return_val = $module->require($version) or die $@;
This works exactly like Perl's require, except without the bareword restriction, and it doesn't die. Since require() is placed in the
UNIVERSAL namespace, it will work on any module. You just have to use UNIVERSAL::require somewhere in your code.
Should the module require fail, or not be a high enough $version, it will simply return false and not die. The error will be in $@ as well
as $UNIVERSAL::require::ERROR.
$module->require or die $@;
use
my $require_return = $module->use or die $@;
my $require_return = $module->use(@imports) or die $@;
Like "UNIVERSAL::require", this allows you to "use" a $module without having to eval to work around the bareword requirement. It returns
the same as require.
Should either the require or the import fail it will return false. The error will be in $@.
If possible, call this inside a BEGIN block to emulate a normal "use" as closely as possible.
BEGIN { $module->use }
SECURITY NOTES
UNIVERSAL::require makes use of "eval STRING". In previous versions of UNIVERSAL::require it was discovered that one could craft a class
name which would result in code being executed. This hole has been closed. The only variables now exposed to "eval STRING" are the
caller's package, filename and line which are not tainted.
UNIVERSAL::require is taint clean.
COPYRIGHT
Copyright 2001, 2005 by Michael G Schwern <schwern@pobox.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
AUTHOR
Michael G Schwern <schwern@pobox.com>
Now maintained by Neil Bowers (NEILB).
SEE ALSO
Module::Load, "require" in perlfunc, <http://dev.perl.org/rfc/253.pod>
perl v5.18.2 2013-09-27 UNIVERSAL::require(3)