Sponsored Content
Full Discussion: Loading variables - Perl
Top Forums Shell Programming and Scripting Loading variables - Perl Post 302407437 by dday on Thursday 25th of March 2010 11:40:18 AM
Old 03-25-2010
It is giving you an error because it hasn't been assigned a value when you try to print it below the "if" logic. If you move that second print statement outside the function, it should've been assigned while going through the logic. It's hitting the lines that don't include the $userdb entry in the config file and trying to print it anyway during the logic flow.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl global variables

Can someone give me "the lecture" on why you shouldn't make all your varables global when programming in perl. I have been doing this but I have heard that it is not a good practice. (3 Replies)
Discussion started by: reggiej
3 Replies

2. Shell Programming and Scripting

Function loading in a shell scripting like class loading in java

Like class loader in java, can we make a function loader in shell script, for this can someone throw some light on how internally bash runs a shell script , what happenes in runtime ... thanks in advance.. (1 Reply)
Discussion started by: mpsc_sela
1 Replies

3. Shell Programming and Scripting

Help loading a program into perl from a file on desktop

So I want to use this program that I have downloaded from: PaGE - Patters from Gene Expression However, I am not sure how to actually get in to and run the program... I can log into the server, and was assuming I needed to get the "PaGE_5.1.6.pl" file into a folder some how, but not sure how to... (2 Replies)
Discussion started by: silkiechicken
2 Replies

4. Shell Programming and Scripting

Perl - Error loading module.

Hi, I have a strange issue in my script. When script is run from command prompt it runs fine,but when run from cron it exist with error message. I narrowed down the issue and found that " use Mail::Sender;" is the culprit. If I comment the statment the code runs fine in both command and... (9 Replies)
Discussion started by: coolbhai
9 Replies

5. Shell Programming and Scripting

using variables in perl not working

sdcprd@dotstoas110:$ echo $F2 1327332411 this works ---------- sdcprd@dotstoas110:$ perl -MPOSIX -le 'print strftime ("%m%d%y",localtime (1327332411))' 012312 <<<< correct date this doesnt ----------- sdcprd@dotstoas110:$ perl -MPOSIX -le 'print strftime ("%m%d%y",localtime... (10 Replies)
Discussion started by: aliyesami
10 Replies

6. Shell Programming and Scripting

Variables in perl

I don't fully understand variables in perl. If we have a variable defined like this "my $number = 1" then this is called a lexical variable? But if you define this at the top of a script then why isn't it a global variable because it would be available throughout the file? Sorry if this is... (1 Reply)
Discussion started by: P3rl
1 Replies

7. UNIX for Dummies Questions & Answers

Global variables in perl

hi all, i need a help for the following query. Thanks in advance for your valuable time. i have a main.pl file which has a global variable declared as below. our myVar=0; call first.pl script from the main.pl script. print the value of myVar (the value is still 0 and not 10.) i have a... (1 Reply)
Discussion started by: hemalathak10
1 Replies

8. Shell Programming and Scripting

Perl : Loading moduled in local directory.

I have the need to load modules in a local directory. I am a perl new guy. When I test Net::SSH2, I get the following message. I did load the required libssh2. Not sure where to go from here. Is there a way to test that libssh2 is loaded correctly ? (1 Reply)
Discussion started by: popeye
1 Replies

9. UNIX for Dummies Questions & Answers

Variables in perl script

Hi Chaps, Im after some advise with a script i've written however doesnt appear to work how I would like. Basically I have a perl script which sucessfully pulls an expect script to login to multiple nodes and obtain some output from the nodes (total number of nat ports that are in use... (0 Replies)
Discussion started by: mutley2202
0 Replies

10. Programming

PERL: In a perl-scripttTrying to execute another perl-script that SETS SOME VARIABLES !

I have reviewed many examples on-line about running another process (either PERL or shell command or a program), but do not find any usefull for my needs way. (Reviewed and not useful the system(), 'back ticks', exec() and open()) I would like to run another PERL-script from first one, not... (1 Reply)
Discussion started by: alex_5161
1 Replies
VBE(5)						      VHDL subset of ASIM/LIP6/CAO-VLSI lab.						    VBE(5)

NAME
vbe VHDL behavioural subset. ORIGIN
This software belongs to the ALLIANCE CAD SYSTEM developed by the ASIM team at LIP6 laboratory of Universite Pierre et Marie CURIE, in Paris, France. Web : http://asim.lip6.fr/recherche/alliance/ E-mail : alliance-users@asim.lip6.fr DESCRIPTION
This document describes the ALLIANCE VHDL subset for behavioural data flow descriptions. CONCURRENT STATEMENTS In a data flow architecture only concurrent statements (except process) are supported. All sequential statements including loops, signal assignment, etc .. are to be banished. Allowed concurrent statements are: simple signal assignment conditional signal assignment selected signal assignment concurrent assert statement block statement BUSES When using concurrent statements, an ordinary signal can be assigned only once. The value of the signal must be explicitly defined by the signal assignment (for example, in a selected signal assignment the value of the target signal is to be defined for every value that the select expression can take). The above constraint may be felt as a hard restriction when designing distributed controled hardware (precharged line, distributed multi- plexer, etc ...). To hurdle this, VHDL uses a special feature: guarded-resolved signals. A resolved signal is a signal declared with a resolved subtype (see vhdl(5)). A resolved subtype is a type combined with a resolution function. A resolved signal can be assigned by multiple signal assignments. Depending on the value of each driver, the resolution function determines the effective value of the signal. A guarded signal is a resolved signal with drivers that can be disconected. A guarded signal must be assigned inside a block statement through a guarded signal assignment. A distributed multiplexer may be described as : signal Distributed_Mux : mux_bit bus; begin first_driver_of_mux : block (Sel1 = '1') begin Distributed_Mux <= guarded Data1; end block; second_driver_of_mux : block (Sel2 = '1') begin Distributed_Mux <= guarded Data2; end block; LATCHES and REGISTERS Sequential elements must be explicitly declared using the type reg_bit or reg_vector (and must be of kind register). A sequential element must be assigned inside a block statement by a guarded signal assignment. Rising edge triggered D flip flop : signal Reg : reg_bit register; begin flip_flop : block (ck = '1' and not ck'STABLE) begin Reg <= guarded Din; end block; Level sensitive latch: signal Reg : reg_bit register; begin latch : block (ck = '1') begin Lat <= guarded Din; end block; In both cases, the guard expression must depend only on one signal if the description is to be processed by the logic synthetizer (boom + boog). The following operators are only supported: not, and, or, xor, nor, nand, &, =, /= They can be applied on all types supported by the subset. Other standard VHDL operators (+, -, >, <, ...) have not been implemented in the present release. TIMING Timing information can be specified in behavioural descriptions using after clauses. However, those delays are currently only used for sim- ulation. After clauses are supported but not used for synthesis and formal proof. After clauses in block statements (for guarded signal assignments) are not supported for sequential elements (signals of kind register), but supported for bus elements (signals of kind bus). This is because the VHDL default disconnection time is null and this can generate unexpected behavior for sequential elements. In selected signal assignment, only uniform delays are supported (the same After clause in all assignments). Transport option is not supported. All delays are inertial delays. ASSERT STATEMENT Only two severity levels are supported in concurrent assert statements: warning print a warning message if the assert condition is not satisfied. error print an error message if the assert condition is not satisfied. Then, stop the simulation. Assert statements are ignored by the logic synthesis tool. DON'T CARE A special feature has been introduced in order to allow "don't care" specification when the logic synthtizer is targeted ( Beware : this feature is incompatible with the IEEE VHDL standard !!). An output can be assigned to the value 'D' (don't care). This is taken into account by the logic synthesis tool in the optimization process. When the value of an output is 'D' the logic synthesis tool may turn it into a '1' or a '0'. A 'D' value is understood as a '0' by the logic simulator (asimut). ARRAIES Arraies other than bit_vector, reg_vector, mux_vector and wor_vector are not supported. EXAMPLES
Here is the description of an adder with an accumulator register. entity add_accu is port ( clk : in bit; command : in bit; data_in : in bit_vector (31 downto 0); data_out : out bit_vector (31 downto 0); cry_out : out bit; vdd : in bit; vss : in bit ); end add_accu; architecture data_flow of add_accu is signal eff_data : bit_vector (31 downto 0); -- effective operande signal adder_out : bit_vector (31 downto 0); -- adder's result signal adder_cry : bit_vector (32 downto 0); -- adder's carry signal accum_reg : reg_vector (31 downto 0) register; -- accumulator constant initialize : bit := '0'; constant accumulate : bit := '1'; begin -- select the effective operand with command select eff_data <= X"0000_0000" when initialize, accum_reg when accumulate; -- compute the result out of the adder adder_out <= eff_data xor data_in xor adder_cry; adder_cry (0) <= '0'; adder_cry (32 downto 1) <= (eff_data and adder_cry (31 downto 0)) or (data_in and adder_cry (31 downto 0)) or (aff_data and data_in ) ; -- write the result into the register on the rising edge of clk write : block (clk = '1' and not clk'STABLE) begin accum_reg <= guarded adder_out; end block; -- assign outputs cry_out <= adder_cry (32); data_out <= accum_reg ; -- check power supply assert (vdd = '1' and vss = '0') report "power sypply is missing" severity ERROR; end; SEE ALSO
vhdl(5), vst(5), boom(1), loon(1), boog(1), asimut(1), proof(1) BUG REPORT
This tool is under development at the ASIM department of the LIP6 laboratory. We need your feedback to improve documentation and tools. ASIM
/LIP6 October 1, 1997 VBE(5)
All times are GMT -4. The time now is 12:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy