Sponsored Content
Full Discussion: perl package question
Top Forums Shell Programming and Scripting perl package question Post 302123712 by hankooknara on Tuesday 26th of June 2007 09:42:16 PM
Old 06-26-2007
perl package question

can someone tell me how below package command worked?

I understand how global1.pl works.. but i don't see how global3.pl is working..
Is package Fred command having first output look into $main:name???

[root@localhost perl]# cat global3.pl
#!/usr/bin/perl -w

#use strict;

$main::name = "Your name Here";
$Fred::name = "Fred Flintstone";
$Barney::name = "Barney Rubble";

print "\$name in package main is $name\n";
package Fred;
print "\$name in package Fred is $name\n";
package Barney;
print "\$name in package Barney is $name\n";
package main;
[root@localhost perl]# cat global1.pl
#!/usr/bin/perl -w

#use strict;

$main::name = "Your name Here";
$Fred::name = "Fred Flintstone";
$Barney::name = "Barney Rubble";

print "\$name in package main is $name\n";
print "\$name in package Fred is $Fred::name\n";
print "\$name in package Barney is $Barney::name\n";
[root@localhost perl]# ./global3.pl
$name in package main is Your name Here
$name in package Fred is Fred Flintstone
$name in package Barney is Barney Rubble
[root@localhost perl]# ./global1.pl
$name in package main is Your name Here
$name in package Fred is Fred Flintstone
$name in package Barney is Barney Rubble
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl: globals and a package.

I am still learning perl and confused on this script I am revising at work. The original author uses a package, which I have left in the code; however, I cannot seem to access the global variable $dir. Code snippet: I have also tried using $RRD_MG::dir to no avail. Thank you. (6 Replies)
Discussion started by: effigy
6 Replies

2. Solaris

solaris package question

I'm trying to install GNU C compiler. I have the binary downloaded, and add it using a pkgadd -d command. Is there anything else I need to do? Thanks. (7 Replies)
Discussion started by: ECBROWN
7 Replies

3. Solaris

dsteam package question

Hi, What is the different between regular solaris package and dstream package? I am not sure about dsteam package. What is it? thanks in advance (2 Replies)
Discussion started by: mokkan
2 Replies

4. UNIX for Dummies Questions & Answers

Question on install software package on Linux

Hello ALL, I am not very sure about the following two questions, I have install some packages on my Linux system, though. Q1. Should I log in as root to install a software package on a Linux system? Q2. If I log in as a common user, say 'Mike', and install a software on Mike's home... (1 Reply)
Discussion started by: cy163
1 Replies

5. Linux

RPM Package question

Hi, I have built one RPM last year. now we have another version of that RPM. in previous release we had few extra files then now. so when user upgrade it those files get deleted by RPM package. We want to retain those files. now for workaround i thought of backing up those file during... (0 Replies)
Discussion started by: ajayyadavmca
0 Replies

6. Shell Programming and Scripting

perl for dbms_stats package

Hi, i am new to perl and i used to manullay gathering statistics since our database servers are 8i, could any body help to get the perl script or any link to automate this work. Thanks Prakash (1 Reply)
Discussion started by: prakash.gr
1 Replies

7. Shell Programming and Scripting

Java package restructuring using shell/sed/perl

Hi we are having more than 10k file source code clutterred across different directories. 1. we want to find duplicate file name 2. all java files and having having below content in various folder under /home/raxit/src --------- /*comment etc for few line */ package hello.a.b.c; ... (0 Replies)
Discussion started by: raxitsheth
0 Replies

8. Cybersecurity

Question on a security package on linux

Hello everyone , I want to implement a new firewall, detection system on my network composed of some 200 computers as follows: The fire wall would be a linux box with router, L7 iptable and also snort as IDPS system. These are my questions: 1. Is there any security consideration regarding... (0 Replies)
Discussion started by: ahmedkamel
0 Replies

9. Shell Programming and Scripting

Using localisation of a Perl package

I have a Perl package, which is widely used and tested, but recently a version in another language was added. The relevant po-files have been reviewed for this and are ready for testing. What are the steps to select the language by the user? From my understanding the language environment variable... (3 Replies)
Discussion started by: figaro
3 Replies

10. Shell Programming and Scripting

<<< Question related to making of RPM package >>>

Hi all, Pls provide your suggestions and advice for the below queries. I have a files like below sample $ ls -l /u01/app -rw-r--r-- 1 appusr appdba 4 Feb 20 21:35 test -rw-r--r-- 1 appusr appdba 4 Feb 20 21:35 test1 -rw-r--r-- 1 appusr appdba 4 Feb 20 21:35 test -... (1 Reply)
Discussion started by: kamauv234
1 Replies
platform::shell(n)					       Tcl Bundled Packages						platform::shell(n)

__________________________________________________________________________________________________________________________________________________

NAME
platform::shell - System identification support code and utilities SYNOPSIS
package require platform::shell ?1.1.4? platform::shell::generic shell platform::shell::identify shell platform::shell::platform shell _________________________________________________________________ DESCRIPTION
The platform::shell package provides several utility commands useful for the identification of the architecture of a specific Tcl shell. This package allows the identification of the architecture of a specific Tcl shell different from the shell running the package. The only requirement is that the other shell (identified by its path), is actually executable on the current machine. While for most platform this means that the architecture of the interrogated shell is identical to the architecture of the running shell this is not generally true. A counter example are all platforms which have 32 and 64 bit variants and where a 64bit system is able to run 32bit code. For these running and interrogated shell may have different 32/64 bit settings and thus different identifiers. For applications like a code repository it is important to identify the architecture of the shell which will actually run the installed packages, versus the architecture of the shell running the repository software. COMMANDS
platform::shell::identify shell This command does the same identification as platform::identify, for the specified Tcl shell, in contrast to the running shell. platform::shell::generic shell This command does the same identification as platform::generic, for the specified Tcl shell, in contrast to the running shell. platform::shell::platform shell This command returns the contents of tcl_platform(platform) for the specified Tcl shell. KEYWORDS
operating system, cpu architecture, platform, architecture platform::shell 1.1.4 platform::shell(n)
All times are GMT -4. The time now is 08:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy