- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- perl module problem
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2003 08:27 AM
03-10-2003 08:27 AM
$sql = <<'EOT';
select *
from tblCodeEventType
order by description
EOT
I am importing it into a perl script called test.pl using the following:
use storedProcs;
The entire script bombs when I import the module.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2003 08:31 AM
03-10-2003 08:31 AM
Solutionpackage storedProcs;
BEGIN
{
use Exporter();
@ISA = qw(Exporter);
@EXPORT_OK = qw(&sp_EventType &sp_Test);
}
sub sp_EventType
{
#$sql = "Blah, blah, blah";
$sql = q{
select *
from tblCodeEventType
order by description
};
return $sql;
}
sub sp_Test
{
print "
It's aliiiiive!
";}
END{}
1;
indent to your liking
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2003 08:38 AM
03-10-2003 08:38 AM
Re: perl module problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2003 09:50 AM
03-10-2003 09:50 AM
Re: perl module problem
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2003 11:41 AM
03-10-2003 11:41 AM
Re: perl module problem
I have one more question. Can I include arguments passed to my sub within the q{} or qq{} contructs?
ie.
sub sp_EventType(arg1)
{
$sql = q
{
select * from tblCodeEventType where EventType = arg1
};
return $sql;
}
Once again, I am brand new to perl so please forgive my skewed syntax.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2003 04:15 PM
03-10-2003 04:15 PM
Re: perl module problem
so here's my favourite, using the semicolon :)
sub foo ($) # in perl5 you do not (yet) have named arguments
{ # if you want them, pass arguments in a hash
my $tbl = shift; # default arg to shift is @_ in
# sub's which represents the passed arguments
my $sql = qq;
select *
from $tbl
where field = 'blah';
return $sql;
} # foo
# in this case you don't need the $sql variable
and later
my $sql = foo ("clients");
If you're into database access, *please* take a look at the DBI module and the DBD::YourDatabase that fits it. It will make your life soooo much easier.
BTW I forgive your screwed syntax :) the ITRC molests neat indents and lined out spaces anyway, so posting self documenting code is nearly impossible :P
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2003 06:23 AM
03-11-2003 06:23 AM
Re: perl module problem
As you can imagine, this module can become quite large. I read that I can import just the subroutines that I need for a particular perl script and cut the overhead of loading the entire module. Is this correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2003 06:35 AM
03-11-2003 06:35 AM
Re: perl module problem
Please do
# man perlmod
for the specifics. I'm not a module expert :)
Enjoy, have FUN! H.Merijn