|
|
Up |
|
|
  |
Author: PatPat
Date: Jan 23, 2008 23:31
Hi,
This seems like something that would be a FAQ, but I couldn't find an
answer there.
I would like to build a hash from an input text file. The hash can
contain other hashes, and so on, to any depth. The format of the input
file can be anything that is convenient, e.g.:
---------------------------------
root
{
branch_1
{
sub_branch_1
{
leaf_1 = "This is leaf_1"
leaf_2 = "This is leaf_2"
}
}
|
| Show full article (1.22Kb) |
|
| |
8 Comments |
|
  |
Author: PerlFAQ ServerPerlFAQ Server
Date: Jan 23, 2008 18:03
This is an excerpt from the latest version perlfaq8.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .
--------------------------------------------------------------------
8.41: How do I use an SQL database?
The DBI module provides an abstract interface to most database servers
and types, including Oracle, DB2, Sybase, mysql, Postgresql, ODBC, and
flat files. The DBI module accesses each database type through a
database driver, or DBD. You can see a complete list of available
drivers on CPAN: http://www.cpan.org/modules/by-module/DBD/ . You can
read more about DBI on http://dbi.perl.org .
Other modules provide more specific access: Win32::ODBC, Alzabo, iodbc,
and others found on CPAN Search: http://search.cpan.org .
--------------------------------------------------------------------
|
| Show full article (1.56Kb) |
|
| |
no comments
|
|
  |
Author: lala4lifelala4life
Date: Jan 23, 2008 12:27
Hi there
Exists a module to transform RTF to PDF, directly.
In cpan found modules to transform RTF to HTML and then HTML to PDF,
but is lossless HTML is not so rich format as RTF.
Please help.
|
| |
|
1 Comment |
|
  |
Author: kirknew2Regkirknew2Reg
Date: Jan 23, 2008 12:21
I have a column that contains "suite 111" and "suite222"I need a $
variable containing the word part and aother $ variable containing the
digit part. I have tried variations on this syntax:
(\w*)(\d*)(.*)
(\w*)(\s?)(\d*)(.*)
But nothig I have tried seperates the word from the digits when there
is no space. How do i get 'suite222' to brake in to seperate
variables?
|
| |
|
7 Comments |
|
  |
Author: PerlFAQ ServerPerlFAQ Server
Date: Jan 23, 2008 12:03
This is an excerpt from the latest version perlfaq9.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .
--------------------------------------------------------------------
9.25: How do I fetch/put an FTP file?
LWP::Simple (available from CPAN) can fetch but not put. Net::FTP (also
available from CPAN) is more complex but can put as well as fetch.
--------------------------------------------------------------------
The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
are not necessarily experts in every domain where Perl might show up,
so please include as much information as possible and relevant in any
corrections. The perlfaq-workers also don't have access to every
operating system or platform, so please include relevant details for
corrections to examples that do not work on particular platforms.
Working code is greatly appreciated.
If you'd like to help maintain the perlfaq, see the details in
perlfaq.pod.
|
| |
|
no comments
|
|
  |
Author: Grady WeyenbergGrady Weyenberg
Date: Jan 23, 2008 10:32
Hi,
I have @list=($obj_1,$obj_2,...) where each $obj, although of different
classes, have a common inherited method, $obj->name.
I am trying to sort @list alphabetically using the value of $obj->name.
I have tried
@list = sort {$a->name cmp $b->name} @list;
but this fails with:
'Can't call method "name" without a package or object reference.'
and I'm not sure how to pass a reference in this context.
Will this be possible using Perl's sort directly on the object list, or
will I need to write my own sorting function?
Thanks,
Grady
|
| |
|
8 Comments |
|
  |
Author: PerlFAQ ServerPerlFAQ Server
Date: Jan 23, 2008 06:03
This is an excerpt from the latest version perlfaq9.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .
--------------------------------------------------------------------
9.14: How do I make sure users can't enter values into a form that cause my CGI script to do bad things?
See the security references listed in the CGI Meta FAQ
http://www.perl.org/CGI_MetaFAQ.html
--------------------------------------------------------------------
The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
are not necessarily experts in every domain where Perl might show up,
so please include as much information as possible and relevant in any
corrections. The perlfaq-workers also don't have access to every
operating system or platform, so please include relevant details for
corrections to examples that do not work on particular platforms.
Working code is greatly appreciated.
If you'd like to help maintain the perlfaq, see the details in
perlfaq.pod.
|
| |
|
no comments
|
|
  |
Author: paktsardinespaktsardines
Date: Jan 23, 2008 05:54
Dear all,
I have painted myself into a fairly bizarre corner for a fairly
bizarre client. I would be grateful if someone could please help shed
some light on what is going wrong.
Here's the situation in brief:
A. A company has a number of office machines (OMs) that can access the
company's intranet through a browser.
B. Their intranet web server (IWS) provides a web interface containing
a CGI upload form for uploading files from the OMs to a remote web
server (RWS) for processing, the output of which is to be sent back to
the IWS.
C. The OMs are not permitted to access the RWS directly.
Suffice to say that [I think] any upload from an OM has to be done in
two steps. The first is to upload the file to the IWS. The second
step is to upload the file from the IWS to the RWS. ie:
OM -> IWS -> RWS
The first step is working fine using the CGI upload command.. That
is, a user can upload the file from their office machine to a
directory on the IWS.
|
| Show full article (1.69Kb) |
|
6 Comments |
|
  |
Author: rossross
Date: Jan 23, 2008 04:49
Open Letter to Prof. Andrew George, University of DENVER, Dept of
Physics, COLORADO, 80208 USA.
Ref. Einstein's Sep 1905 derivation predicts that,
'When body emits Light Energy, its Mass must also Increase'.
Abstract
To draw scientific conclusions, the knowledge of the paper/topic and
basic aspects of science is necessary. But it has not been so in Prof
Andrew George's comments regarding Ajay Sharma's work on Einstein's
Sep. 1905 paper in the published in Galilean Electrodynamics. Ajay
Sharma has confirmed in various publications that Einstein's Sep. 1905
derivation contradicts law of conservation of matter under some
conditions. This aspect is justified here. Under certain condition
Einstein's Sep 1905 derivation predicts
Mass after emission (Ma)
= Mass before emission (Mb) + (0.04L/10c -L/
c2) (1)
Here ( 0.04L/10c -L/c2 ) is positive quantity.
|
| Show full article (1.18Kb) |
|
no comments
|
|
  |
|
|
  |
Author: PerlFAQ ServerPerlFAQ Server
Date: Jan 23, 2008 00:03
This is an excerpt from the latest version perlfaq9.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .
--------------------------------------------------------------------
9.6: How do I download a file from the user's machine? How do I open a file on another machine?
In this case, download means to use the file upload feature of HTML
forms. You allow the web surfer to specify a file to send to your web
server. To you it looks like a download, and to the user it looks like
an upload. No matter what you call it, you do it with what's known as
multipart/form-data encoding. The CGI.pm module (which comes with Perl
as part of the Standard Library) supports this in the
start_multipart_form() method, which isn't the same as the startform()
method.
See the section in the CGI.pm documentation on file uploads for code
examples and details.
--------------------------------------------------------------------
|
| Show full article (1.68Kb) |
|
no comments
|
|
|
|
|