Sponsored Content
Top Forums Shell Programming and Scripting Perl : Global symbol requires explicit package name Error while executing Post 302785759 by scriptscript on Tuesday 26th of March 2013 10:22:24 AM
Old 03-26-2013
Perl : Global symbol requires explicit package name Error while executing

I have executed the below perl script for copying the file from one server to another server using scp.

Code:
#!/usr/bin/perl -w
use Net::SCP::Expect;
use strict;
$server= "x.x.x.x";
my $source = "/mypath/mypath";
my $destination = "/home/";
print "Login...Starting scp...";
$user="admin";
$password="admin";
print "Login...Starting scp...";
my $scpe = Net::SCP::Expect->new(host=>$server, user=>$user, password=>$password, recursive=>'1', auto_yes => '1', auto_quote => '0');
$scpe->scp('x.x.x.x:/mypath/*.csv',$destination);
print "SCP complete\n";

But I have received the below errors
Code:
DC01INETSRV2[Johng]/s0/home>perl sftptest.pl
Global symbol "$server" requires explicit package name at sftptest.pl line 11.
Global symbol "$user" requires explicit package name at sftptest.pl line 15.
Global symbol "$password" requires explicit package name at sftptest.pl line 16.
Global symbol "$server" requires explicit package name at sftptest.pl line 20.
Global symbol "$user" requires explicit package name at sftptest.pl line 20.
Global symbol "$password" requires explicit package name at sftptest.pl line 20.
Execution of sftptest.pl aborted due to compilation errors.

COuld anyone please help me on the above errors.

Thanks in advance...

Regards,
J
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

SFTP error:-b requires an argument greater than zero

Hi when i execute the below command sftp -b ftpCommand.ksh remoteuser@remoterserver i am getting the error "-b requires an argument greater than zero" Please can any one help me. (1 Reply)
Discussion started by: vgs
1 Replies

2. Shell Programming and Scripting

SFTP error:-b requires an argument greater than zero

Hi when i execute the below command sftp -b ftpCommand.ksh remoteuser@remoterserver i am getting the error "-b requires an argument greater than zero" Please can any one help me. (4 Replies)
Discussion started by: vgs
4 Replies

3. Shell Programming and Scripting

change requires with perl

Hi, i need to change a file with perl having contents below, but it will not do any action if change is being already made. file.txt AAAAAA BBBBBB CCCCCC output.txt (that required) AAAAAA #BBBBB DDDDDD CCCCCC Thanks, (2 Replies)
Discussion started by: learnbash
2 Replies

4. Shell Programming and Scripting

Error executing shell command from a perl script

Hi Gurus, I've a find command that gets the list of files from a source directory where the extension is not html, xml, jsp, shtml or htaccess. The below find command runs fine from the command prompt or in a shell script. I need to eventually run it in a PERL script and am getting the... (5 Replies)
Discussion started by: voorkey
5 Replies

5. Shell Programming and Scripting

Error in executing Perl script

Hello All I am facing an issue The unix script is running fine in unix environment which uses ssh connection but when I try to run the same in informatica environment (same server where I was running the unix script manually successfully) its showing the below error command-line line 0:... (11 Replies)
Discussion started by: Pratik4891
11 Replies

6. UNIX for Dummies Questions & Answers

Can't install rpm package with --prefix in new path.Error: package is not relocatable

Hello, i have downloaded an rpm package "hadoop-0.20.205.0-1.amd64.rpm" in /usr/local/ directory. I'm trying to install the rpm package in a new path/location (/usr/local/hadoop-0.20.205), but i can't. I did: 1st try: Didn't work sudo rpm -i --prefix=/usr/local/hadoop-0.20.205... (1 Reply)
Discussion started by: g_p
1 Replies

7. Emergency UNIX and Linux Support

Problem when trying to remove a package using rpm command - error: package is not installed

Hello, i have installed a package by using the command sudo rpm -i filepackage.rpm package filepackage is already installed when i try to remove it, i get an error saying "is not installed": sudo rpm -e filepackage.rpm error: package filepackage is not installed How can... (4 Replies)
Discussion started by: g_p
4 Replies

8. Shell Programming and Scripting

Perl : meaning of ||= symbol

While going through the below perl code, there is a line which contains $sheet -> {MaxRow} ||= $sheet -> {MinRow}; Could anyone please explain the meaning of ||= and where it is used complete code --------------- foreach my $sheet (@{$excel -> {Worksheet}}) { ... (2 Replies)
Discussion started by: giridhar276
2 Replies

9. Shell Programming and Scripting

Executing perl script in Linux gives :Exec format error. Wrong Architecture

i have perl script that used to be working great , once i edit it in windows and convert it to UTF-8 and then via FTP return it . also did: chmod +x foo.pl and then when i try to run it : ./foo.pl im getting this error: ./foo.pl: Exec format error. Wrong Architecture.... (4 Replies)
Discussion started by: umen
4 Replies

10. Solaris

Global zone has an older version of package: pkg://Solaris/system/library

I try to install php-56 in a zone, but I have the following problem: pkg install php-56 Creating Plan (Running solver): \ pkg install: No solution was found to satisfy constraints maintained incorporations: None Creation Plan: dependency error (s) in proposed packages: Not... (0 Replies)
Discussion started by: ymk369
0 Replies
libapache2-mod-perl2-2.0.7::docs::api::ModPerl::Global(3User Contributed Perl Documentalibapache2-mod-perl2-2.0.7::docs::api::ModPerl::Global(3pm)

NAME
ModPerl::Global -- Perl API for manipulating special Perl lists Synopsis use ModPerl::Global (); my $package = 'MyApache2::Package'; # make the END blocks of this package special ModPerl::Global::special_list_register(END => $package); # Execute all encoutered END blocks from this package now ModPerl::Global::special_list_call( END => $package); # delete the list of END blocks ModPerl::Global::special_list_clear( END => $package); Description "ModPerl::Global" provides an API to manipulate special perl lists. At the moment only the "END" blocks list is supported. This API allows you to change the normal Perl behavior, and execute special lists when you need to. For example "ModPerl::RegistryCooker" uses it to run "END" blocks in the scripts at the end of each request. Before loading a module containing package $package, you need to register it, so the special blocks will be intercepted by mod_perl and not given to Perl. "special_list_register" does that. Later on when you want to execute the special blocks, "special_list_call" should be called. Unless you want to call the list more than once, clear the list with "special_list_clear". API
"ModPerl::Global" provides the following methods: "special_list_call" Call the special list $ok = special_list_call($key => $package); arg1: $key ( string ) The name of the special list. At the moment only 'END' is supported. arg2: $package ( string ) what package to special list is for ret: $ok ( boolean ) true value if $key is known, false otherwise. since: 2.0.00 "special_list_clear" Clear the special list $ok = special_list_clear($key => $package); arg1: $key ( string ) The name of the special list. At the moment only 'END' is supported. arg2: $package ( string ) what package to special list is for ret: $ok ( boolean ) true value if $key is known, false otherwise. since: 2.0.00 "special_list_register" Register the special list $ok = special_list_call($key => $package); arg1: $key ( string ) The name of the special list. At the moment only 'END' is supported. arg2: $package ( string ) what package to special list is for ret: $ok ( boolean ) true value if $key is known, false otherwise. since: 2.0.00 Notice that you need to register the package before it is loaded. If you register it after, Perl has already compiled the "END" blocks and there are no longer under your control. See Also mod_perl 2.0 documentation. Copyright mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0. Authors The mod_perl development team and numerous contributors. perl v5.14.2 2011-02-08 libapache2-mod-perl2-2.0.7::docs::api::ModPerl::Global(3pm)
All times are GMT -4. The time now is 09:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy