Icecrack 174
Recognized Expert New Member
Thanks in Advance,
when declaring GLOBAL Variables can we use qw() ?
example: - my qw($data $id $test $var);
etc.
i will be testing this but if any one knows with in the next 1 hr please post
thanks
Thank You,
Charlie
6 7436
'my' is used to declare local variables. To declare multiple variables at once, you may use: -
my ($data,$id,$test,$var);
-
qw() can be used only on RHS of any assignment statement, as in: -
my @a = qw(ad sat d f g);
-
-Nithin
Icecrack 174
Recognized Expert New Member
'my' is used to declare local variables.
Thank's i know that you may use: - use var qw($test $perl $var $etc);
NeoPa 32,584
Recognized Expert Moderator MVP
Charlie,
There seems to have been a little misunderstandin g about what the Experts area is for.
Not a problem. I can move this thread for you, but technical questions still go in the relevant technical forum.
The Experts forum is for directing the attention of other experts to a tricky problem thread, or discussing issues related to the experts generally.
KevinADC 4,059
Recognized Expert Specialist
Thanks in Advance,
when declaring GLOBAL Variables can we use qw() ?
example: - my qw($data $id $test $var);
etc.
i will be testing this but if any one knows with in the next 1 hr please post
thanks
Thank You,
Charlie
If you look up qw in perl operators you will see it also does not interpolate variables. In other words, its the same as using single-quotes, so scalars will not be interpolated when used in a qw list. - $foo = 'test';
-
my @list = qw($foo);
-
print $list[0];
prints $foo
KevinADC 4,059
Recognized Expert Specialist
Thank's i know that you may use: - use var qw($test $perl $var $etc);
Yes that is OK, because it supplies a list to the vars pragma. Note that "vars" is obsolete but still supported.
Icecrack 174
Recognized Expert New Member
Yes that is OK, because it supplies a list to the vars pragma. Note that "vars" is obsolete but still supported.
Thank you all for your input,
Charlie
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Andrew V. Romero |
last post by:
I have been working on a function which makes it easier for me to pull
variables from the URL. So far I have:
<script language="JavaScript">
var variablesInUrl;
var vArray = new Array();
function loadUrlVariables()
{
varString = location.search;
|
by: MLH |
last post by:
A97 Topic: If there is a way to preserve the values assigned to
global variables when an untrapped runtime error occurs? I don't
think there is, but I thought I'd ask.
During development, I'm constantly running tests on imperfect code.
On of the cumbersome jobs encountered is reassigning global vars
their values after a close encounter with an untrapped runtime error.
Rather than writing a procedure to simply reassign them all with a...
|
by: MLH |
last post by:
I've read some posts indicating that having tons of GV's in
an Access app is a bad idea. Personally, I love GVs and I
use them (possibly abuse them) all the time for everything
imaginable - have been for years. If the machine has memory
to spare and windows can use it - I'm thinking "Why not?"
I was wondering what some of you have to say about that,
particularly any severe "gotchas" you've had the unfortunate
experience to contend with.
|
by: CDMAPoster |
last post by:
About a year ago there was a thread about the use of global variables
in A97:
http://groups.google.com/group/comp.databases.ms-access/browse_frm/thread/fedc837a5aeb6157
Best Practices by Kang Su Gatlin, casual mention was made about using
static variables as an alternative to using global variables. This
caused me to think of the following:
'-----Begin module code
|
by: Sandman |
last post by:
I dont think I understand them. I've read the section on scope in the
manual inside out.
I'm running PHP 5.2.0 Here is the code I'm working on:
//include_me.php
<?php
$MYVAR = array();
global $MYVAR, $a;
?>
| |
by: pcaisse |
last post by:
I'm having issues sharing global variables with Explorer. This problem probably has a simple answer (as with most newbie questions).
The script.pl file:
#!/usr/bin/perl -w
use strict;
use diagnostics;
use sigtrap;
|
by: weaknessforcats |
last post by:
C++: The Case Against Global Variables
Summary
This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have called it polluting the global namespace. This article explores what happens when the global namespace becomes polluted and how to avoid this condition.
The opinions expressed in this article are those of the author alone although many have...
|
by: rottmanj |
last post by:
. In order to teach my self more. I have started to convert some of my cf scheduled tasks to perl applications.
One area where things are kind of fuzzy is setting up global variables that can be called from any module with in an application.
So far I have created a farily standard module that will act as my global config. This module will store variables that are populated from the database. So that I will not be forced to re-create/query...
|
by: Kelicula |
last post by:
Hello all, I need to create a certain number of variables depending on a result set from a database.
I only want to display 20 records per page, and I would like to have those page "markers" at the botton of the page for NEXT, PREVIOUS, and the links to the actual pages eg: 1, 2, 3 etc..
So far what I have is:
#!c:/Perl/bin/perl
use strict;
|
by: istillshine |
last post by:
When I control if I print messages, I usually use a global variable
"int silent". When I set "-silent" flag in my command line
parameters, I set silent = 1 in my main.c.
I have many functions that may print some messages.
foo(...)
{
if (!silent)
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |