--- Hakan Aksu <[EMAIL PROTECTED]> wrote:
> thanks for the response.
> However my problem is not calling the variables. but calling the module.
>
> Let says I have this directory structure :
>
> ~myapp/class1/foo.pm
> ~myapp/class2/foo.pm
> ~myapp/class3/foo.pm
>
> and my @INC has "~myapp/"
>
Use is a "declaration" so you may want to "use" all of them ... then "call"
the one wanted from main ... meaning the name of the sub would need to
reflect which "class" "foo1, foo2, foo3" ...
perl -e 'print "class ?:";
$class=<>;chomp($class);
$sub="foo$class";
&$sub;
print "back from <$sub>\n";
thanks for the response.
However my problem is not calling the variables. but calling the module.
Let says I have this directory structure :
~myapp/class1/foo.pm
~myapp/class2/foo.pm
~myapp/class3/foo.pm
and my @INC has "~myapp/"
I wan to call :
use class?::foo; #dynamic
where class? is
hkn wrote:
>
> Can someone please tell me how I can pass variables when using "use" ?
>
create a file called SomePackage.pm:
package SomePackage;
our $var = "hello world.\n";
1;
__END__
and in the cgi:
#!/usr/bin/perl -w
use strict;
use SomePackage;
print $SomePackage::var;
will return
h
Can someone please tell me how I can pass variables when using "use" ?
sub foo {
my ( $dirname ) = @_;
use $dirname::Variables;# Can't get this running. or any other
combo
# let say if $dirname="Error" e.g: Error/Variables.pm
use Error::Variables; # this
Hope this helps ...
>perl -e '$str="/blabla/dir/nextdir/name.txt";
($path,$filenm)=$str=~m/(^.+)\/(\w+\.\w+$)/;
print "path=<$path>,file name=<$filenm>\n";'
path=,file name=
John W Moon
-Original Message-
From: Bruno Veldeman [mailto:[EMAIL PROTECTED]]
Sent: June 09, 2001 16:08
To: [EMA
step 2 is complete, and is available at:
http://www.peacecomputers.com/addressbook_toot-step2.html
coming next - step 3 - Creating perl classes and our first cgi
Bruno Veldeman wrote:
>
> I have a string with this format "/blabla/dir/nextdir/name.txt"
> I want only 'name.txt' in one string and the rest in another string.
in this case, i would use split:
$location = "/blabla/dir/nextdir/name.txt";
@dirs = split("\/", $location);
foreach (@dirs) { print
Hi,
I can't seem to get the regex right for this:
I have a string with this format "/blabla/dir/nextdir/name.txt"
I want only 'name.txt' in one string and the rest in another string.
It would be nice explaining the regex in plain english.
Or better, how do I learn to use regex?
For now i
How many times do I have to go through the Unsubscribe to stop these?
Anyone??
Shawn
http://www.netzero.net
> "Dave" == Dave Newton <[EMAIL PROTECTED]> writes:
Dave> Randal said:
>> Placeholders are even more cool, and require less thinking.
Dave> If they're supported, which they aren't under all platforms!
They're supported by DBI, so it's *all* platforms. Perhaps you're
thinking of the ":1"-st
Liz said:
> I've not done a great deal of Perl, but with VB we always stripped the
> apostrophes out before putting variables into SQL statements.
I just escape them-why take them out? They do serve a purpose.
Randal said:
> Placeholders are even more cool, and require less thinking.
If they'r
Hey Herb,
I like net::smtp also, but I think it is at a lower level than
Mail::Mailer so you need to know a little more about smtp to use it.
I have not used Mail:: Mailer though.
Wednesday, June 06, 2001, 7:39:45 AM, you wrote:
HH> I have had great success with Net::smtp.
>> I'm wondering how
Not sure I would consider myself a beginner either, but I still have a
long way to go . And yes I would very much like to see a tutorial
like this.
AC> I'm not a beginner, but that sounds like a great way to start up a
AC> discussion about efficient program development. Go for it!
AC> At 02:0
You're the God! Keep it coming. We'll be takin it slowly, but, surely. This is
the REAL Learning Tool. Stick with us on this one.
-- Original Message --
From: fliptop <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Date: Sat, 09 Jun 2001 00:53:15 -040
15 matches
Mail list logo