10-22-2012
Perl: Use variables in "require" file
So lets say I have:
1.pl:
$a = 1;
$b = 2;
require "2.pl";
2.pl
print $a;
How to make 1.pl's variables available to 2.pl? Thanks
Last edited by stevensw; 10-22-2012 at 09:38 PM..
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
2. Shell Programming and Scripting
Hi,
I've modified the syslogd source to include a thread that will keep track of a timer(or a timer thread). My intention is to check the file size of /var/log/messages in every one minute & if the size is more than 128KB, do a echo " " > /var/log/messages, so that the file size will be set... (7 Replies)
Discussion started by: jockey007
7 Replies
3. Shell Programming and Scripting
both ksh/bash support this 2 special variables, Is there any document for reference?
1) "-" is $OLDPWD
2) "$_" is last argument of previous command. (4 Replies)
Discussion started by: honglus
4 Replies
4. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
5. Shell Programming and Scripting
Hi all.
I have a .txt file that I need to sort it
My file is like:
1- 88 chain0 MASTER (FF-TE) FFFF 1962510 /TCK T FD2TQHVTT1 /jtagc/jtag_instreg/updateinstr_reg_1 dff1 (TI,SO)
2- ... (10 Replies)
Discussion started by: Behrouzx77
10 Replies
6. Shell Programming and Scripting
So a script can tell where it's located by the $0 variable right? OK
So what if another script calls "require" on it? Does calling $0 still refer to where it's located? Apparently not, it refers to the script that called require on it. So when that required script tries to call require on other... (4 Replies)
Discussion started by: stevensw
4 Replies
7. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
8. Shell Programming and Scripting
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
9. AIX
Hi 2 all,
i have had AIX 7.2
:/# /usr/IBMAHS/bin/apachectl -v
Server version: Apache/2.4.12 (Unix)
Server built: May 25 2015 04:58:27
:/#:/# /usr/IBMAHS/bin/apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_worker_module (static)
... (3 Replies)
Discussion started by: penchev
3 Replies
LEARN ABOUT DEBIAN
config_list
CONFIG_LIST(8) System Manager's Manual CONFIG_LIST(8)
NAME
config_list - Configure a Mailman mailing list from a text file description
SYNOPSIS
config_list [options] listname
DESCRIPTION
This is a very powerful script which lets you view and modify a list's configuration variables from the command line. E.g. you can dump
out all the list options into a plain text file (actually a valid Python file!), complete with comments explaining each variable. Or you
can apply the configuration from such a file to a particular list.
OPTIONS
-i filename, --inputfile=filename
Configure the list by assigning each module-global variable in the file to an attribute on the list object, then saving the list.
The named file is loaded with execfile() and must be legal Python code. Any variable that isn't already an attribute of the list
object is ignored (a warning message is printed). See also the -c option.
A special variable named `mlist' is put into the globals during the execfile, which is bound to the actual MailList object. This
lets you do all manner of bizarre thing to the list object, but BEWARE! Using this can severely (and possibly irreparably) damage
your mailing list!
-o filename, --outputfile=filename
Instead of configuring the list, print out a list's configuration variables in a format suitable for input using this script. In
this way, you can easily capture the configuration settings for a particular list and imprint those settings on another list. file-
name is the file to output the settings to. If filename is `-', standard out is used.
-c, --checkonly
The modified list is not actually changed. Only useful with -i.
-v, --verbose
Print the name of each attribute as it is being changed. Only useful with -i.
-h, --help
Print a small help text and exit
NOTES
The options -o and -i are mutually exclusive.
AUTHOR
Author of Mailman is the Mailman Cabal, see http://www.list.org/ for information. This manpage is written by Tollef Fog Heen
<tfheen@debian.org> for Debian, but may be used by others.
SEE ALSO
Mailman documentation on http://www.list.org/ and in /usr/share/doc/mailman.
2001-03-10 CONFIG_LIST(8)