Apache
Hello, I installed a webserver "Apache" on my Workstation, the OS is Windows NT4.0 and have a Perl version 5.0.3 My problem is, that I can not execute CGI - SCRIPTS. I get the error message: Forbidden You don't have permission to access /cgi-bin/1st-cgi.pl on this server. Apache/1.3.12 Server at fn0676.zff.zf-group.de Port 3000 I edit the http.conf file, you can see it: ThankĀ“s a lot.. Hasan -- GMX - Die Kommunikationsplattform im Internet. http://www.gmx.net # # Based upon the NCSA server configuration files originally by Rob McCool. # # This is the main Apache server configuration file. It contains the # configuration directives that give the server its instructions. # See http://www.apache.org/docs/> for detailed information about # the directives. # # Do NOT simply read the instructions in here without understanding # what they do. They're here only as hints or reminders. If you are unsure # consult the online docs. You have been warned. # # After this file is processed, the server will look for and process # C:/Programme/Apache Group/Apache/conf/srm.conf and then C:/Programme/Apache Group/Apache/conf/access.conf # unless you have overridden these with ResourceConfig and/or # AccessConfig directives here. # # The configuration directives are grouped into three basic sections: # 1. Directives that control the operation of the Apache server process as a # whole (the 'global environment'). # 2. Directives that define the parameters of the 'main' or 'default' server, # which responds to requests that aren't handled by a virtual host. # These directives also provide default values for the settings # of all virtual hosts. # 3. Settings for virtual hosts, which allow Web requests to be sent to # different IP addresses or hostnames and have them handled by the # same Apache server process. # # Configuration and logfile names: If the filenames you specify for many # of the server's control files begin with "/" (or "drive:/" for Win32), the # server will use that explicit path. If the filenames do *not* begin # with "/", the value of ServerRoot is prepended -- so "logs/foo.log" # with ServerRoot set to "/usr/local/apache" will be interpreted by the # server as "/usr/local/apache/logs/foo.log". # # NOTE: Where filenames are specified, you must use forward slashes # instead of backslashes (e.g., "c:/apache" instead of "c:\apache"). # If a drive letter is omitted, the drive on which Apache.exe is located # will be used by default. It is recommended that you always supply # an explicit drive letter in absolute paths, however, to avoid # confusion. # ### Section 1: Global Environment # # The directives in this section affect the overall operation of Apache, # such as the number of concurrent requests it can handle or where it # can find its configuration files. # # # ServerType is either inetd, or standalone. Inetd mode is only supported on # Unix platforms. # ServerType standalone # # ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept. # # Do NOT add a slash at the end of the directory path. # ServerRoot "C:/Programme/Apache Group/Apache" # # PidFile: The file in which the server should record its process # identification number when it starts. # PidFile logs/httpd.pid # # ScoreBoardFile: File used to store internal server process information. # Not all architectures require this. But if yours does (you'll know because # this file will be created when you run Apache) then you *must* ensure that # no two invocations of Apache share the same scoreboard file. # ScoreBoardFile logs/apache_status # # In the standard configuration, the server will process httpd.conf, # srm.conf, and access.conf in that order. The latter two files are # now distributed empty, as it is recommended that all directives # be kept in a single file for simplicity. The commented-out values # below are the built-in defaults. You can have the server ignore # these files altogether by using "/dev/null" (for Unix) or # "nul" (for Win32) for the arguments to the directives. # #ResourceConfig conf/srm.conf #AccessConfig conf/access.conf # # Timeout: The number of seconds before receives and sends time out. # Timeout 300 # # KeepAlive: Whether or not to allow persistent connections (more than # one request per connection). Set to "Off" to deactivate. # KeepAlive OFF # # MaxKeepAliveRequests: The maximum number of requests to allow # during a persistent connection. Set to 0 to allow an unlimited amount. # We reccomend you leave this number high, for maximum performance. # MaxKeepAliveRequests 100 # # KeepAliveTimeout: Number of seconds to wait for the next request from the # same client on the same connection. # KeepAliveTimeout 15 # # Apache on Win32 always creates one child process to handle requests. If it # d
Re: beginner here - with basic cgi trouble
On Thu, 10 May 2001, lemoninsz wrote: > hi,i have the same problem,when i do ./emailupload.cgi,error like this: > "bash: ./emailupload.cgi: No such file or directory" > > the other cgi scripts work well,but emailupload.cgi.the following is the >emailupload.cgi: > #!/usr/bin/perl ^ Is this the correct path to Perl? -- Brett http://www.chapelperilous.net/btfwk/ Lewis's Law of Travel: The first piece of luggage out of the chute doesn't belong to anyone, ever.
RE: @INC
On Wed, 9 May 2001, Stephen E. Hargrove wrote: > doesn't this just make the adjustment at compile time? what i'm really > needing is something that will modify @INC for all time. can that be > done? perldoc -q INC ...bunch of stuff... How do I add a directory to my include path at runtime? Here are the suggested ways of modifying your include path: the PERLLIB environment variable the PERL5LIB environment variable the perl -Idir command line flag the use lib pragma, as in use lib "$ENV{HOME}/myown_perllib"; The latter is particularly useful because it knows about machine dependent architectures. The lib.pm pragmatic module was first included with the 5.002 release of Perl. -- Brett http://www.chapelperilous.net/btfwk/ Lazlo's Chinese Relativity Axiom: No matter how great your triumphs or how tragic your defeats -- approximately one billion Chinese couldn't care less.
RE: @INC
On May 9, Stephen E. Hargrove said: >-BEGIN PGP SIGNED MESSAGE- >Hash: SHA1 > >On Thu, 10 May 2001, King, Jason wrote: > >> Stephen E. Hargrove writes .. >> >> >how do i add new directories to @INC? i've managed to bungle one of my >> >debian systems, and apt-get relies pretty heavily on some .pm's that >> >aren't in the stock @INC locations. >> >> there's a hand module called 'lib' that's part of the CORE distribution .. >> it basically just unshifts your list onto the @INC array in a BEGIN block >> >> use lib qw'/dirs/for /inclusion /in/INC'; > > >doesn't this just make the adjustment at compile time? what i'm really >needing is something that will modify @INC for all time. can that be >done? You can't do it for EVERYTHING unless you recompile Perl. You can do it for yourself all the time by setting the PERL5LIB environment variable to a colon-separated list of directories to add to @INC automatically. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/ Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/ Acacia Fraternity, Rensselaer Chapter. Brother #734
RE: @INC
Stephen E. Hargrove writes .. >On Thu, 10 May 2001, King, Jason wrote: > >> Stephen E. Hargrove writes .. >> >> >how do i add new directories to @INC? i've managed to >bungle one of my >> >debian systems, and apt-get relies pretty heavily on some .pm's that >> >aren't in the stock @INC locations. >> >> there's a hand module called 'lib' that's part of the CORE >distribution .. >> it basically just unshifts your list onto the @INC array in >a BEGIN block >> >> use lib qw'/dirs/for /inclusion /in/INC'; > > >doesn't this just make the adjustment at compile time? what i'm really >needing is something that will modify @INC for all time. can that be >done? you need to recompile Perl then .. the directories included in the @INC array are stored in the perl binary when Perl was originally built .. you can't change them without rebuilding Perl if you wanted to avoid hardcoding the @INC directories in every script you write you could put your own module into one of the @INC directories to be called by all your programs - and it would - in turn - load the other @INC directories .. ie. your module might be as follows package my_lib; use lib qw'/dirs/for /inclusion /in/INC'; 1; then in all your programs you'd have #!perl -w use strict; use my_lib; # .. code .. __END__ -- jason king In Denmark, if a horse carriage is trying to pass a car and the horse gets uneasy, the car is required to pull over and stop. If necessary to ease the horse down, you are required to cover the car up. - http://dumblaws.com/
RE: @INC
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, 10 May 2001, King, Jason wrote: > Stephen E. Hargrove writes .. > > >how do i add new directories to @INC? i've managed to bungle one of my > >debian systems, and apt-get relies pretty heavily on some .pm's that > >aren't in the stock @INC locations. > > there's a hand module called 'lib' that's part of the CORE distribution .. > it basically just unshifts your list onto the @INC array in a BEGIN block > > use lib qw'/dirs/for /inclusion /in/INC'; doesn't this just make the adjustment at compile time? what i'm really needing is something that will modify @INC for all time. can that be done? - -- ) ,_) (-(__ -|- __ ) | (/_\/(/_ ( ___ | mailto : [EMAIL PROTECTED] | | linux : http://exitwound.org | | mozart : http://mozart.sourceforge.net| | buck : http://www.BuckOwensFan.com | ___ | I go on working for the same reason a hen | | goes on laying eggs. -- H.L. Mencken | ___ -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.4 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE6+fSNr9c0KwefYXMRAjAtAKCEp3TrDOcWtaNyMu8AYaOrxozDWwCePChM I1/wWd7XBwa+9JpwIDY6Bhg= =dGAV -END PGP SIGNATURE-
RE: @INC
Stephen E. Hargrove writes .. >how do i add new directories to @INC? i've managed to bungle one of my >debian systems, and apt-get relies pretty heavily on some .pm's that >aren't in the stock @INC locations. there's a hand module called 'lib' that's part of the CORE distribution .. it basically just unshifts your list onto the @INC array in a BEGIN block use lib qw'/dirs/for /inclusion /in/INC'; -- jason king In Denmark, if a horse carriage is trying to pass a car and the horse gets uneasy, the car is required to pull over and stop. If necessary to ease the horse down, you are required to cover the car up. - http://dumblaws.com/
@INC
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 how do i add new directories to @INC? i've managed to bungle one of my debian systems, and apt-get relies pretty heavily on some .pm's that aren't in the stock @INC locations. - -- ) ,_) (-(__ -|- __ ) | (/_\/(/_ ( ___ | mailto : [EMAIL PROTECTED] | | linux : http://exitwound.org | | mozart : http://mozart.sourceforge.net| | buck : http://www.BuckOwensFan.com | ___ | Nothing increases your golf score like| | witnesses.| ___ -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.4 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE6+eynr9c0KwefYXMRAg9LAKCJJErE+lxc5WTVvy/jfZMHzJ4xIACfUIB/ rmG3quvJ/83+UMrp8pFesS8= =87LP -END PGP SIGNATURE-
RE: IDE for perl?
Brett W. McCoy writes .. >On Wed, 9 May 2001, Rod Suter wrote: > >> I'm using perl through emacs, but I want to bring along some >people on >> NT4.0. They're accustomed to Visual Studio, and want IDE features, >> such as project directories, global search and replace, debugger >> linking, source code error hilighting, etc. Can anyone suggest a good >> group environment for developing perl? My first urge is to set up >> Ultra-Edit with some appropriate customization. > >Doesn't ActiveState have a VisualPerl? There's also Komodo, which is >built on Mozilla. I tried to get VisualPerl up and running on my Win2k machine here .. could get it working .. it relies on the .NET framework - which is still not release quality code .. and the debugger just kept crashing so based on that I'd recommend the originator goes for Komodo (although I haven't tried it) >Of course, you can also use emacs on Windows -- it has everything you >describe (syntax highlighting, search and replace, etc). and just because it *has* to be said .. I use Vim on windows for all my Perl .. with the ActiveState graphical debugger from the PDK .. great toolset (no 'projects' though .. I let the filesystem be my project) -- jason king In Denmark, if a horse carriage is trying to pass a car and the horse gets uneasy, the car is required to pull over and stop. If necessary to ease the horse down, you are required to cover the car up. - http://dumblaws.com/
RE: Very beginner question
[EMAIL PROTECTED] writes .. >(name = john) - >if I am trying to just extract "john" for the value $b, why would the >following script not work. I thought it would take bothIt returns the >full (name=john) > >#!user/local/bin/perl -w > >open TRY , "try.txt"; > >while () { > (my $b=$_) =~ s/^(\() (\w+)/$2/; > print $b; >} in the name of TMTOWTDI while() { chop( my $name = substr $_, rindex( $_, ' ')+1); print $name, "\n"; } but I suspect (from the statement about the output being '(name=john)') that those spaces might not always be there .. in which case while() { /=\s*(.*)\)/ && print $1, "\n"; } -- jason king In Denmark, if a horse carriage is trying to pass a car and the horse gets uneasy, the car is required to pull over and stop. If necessary to ease the horse down, you are required to cover the car up. - http://dumblaws.com/
RE: newbie: CPAN module usage.
SS HK writes .. >I would like to install some of the CPAN modules. How >can I do that. I am using ActivePerl on Windows. > >Any pointers would be greatly helpful. while others have mentioned 'ppm' which should be your first port of call .. there are only a limited number of modules (albeit the commonly used ones) that have been made available via ppm so .. if you need to grab a module from CPAN then you will need nmake.exe for building the modules .. in some instances you will also need a C compiler nmake comes with Microsoft Visual C++ .. which also has nmake .. so if you have access to that then install it otherwise .. you can get a free version of nmake from Microsoft .. which will mean that you will not be able to install any modules that require compilation .. but you can install pure Perl modules (which accounts for a fairly high proportion) I'm not going to tell you where the free nmake is because you'll learn a lot more than I'm telling you here by reading the ActivePerl documentation - which also tells you where to find nmake get to the ActivePerl documentation on your Start > Programs menu .. read the section of the ActivePerl FAQ entitled "Modules & Samples" .. and then read all the rest of the FAQ .. it has all the information you need (one hint: where it talks about gzip and tar - you can use WinZip for both untarring and ungzipping the archives) -- jason king In Denmark, if a horse carriage is trying to pass a car and the horse gets uneasy, the car is required to pull over and stop. If necessary to ease the horse down, you are required to cover the car up. - http://dumblaws.com/
Re: Cookies
On Wed, May 09, 2001 at 02:48:54PM -0400, Casey West wrote: : On Wed, May 09, 2001 at 03:45:40PM -0400, Brian Shoemaker wrote: : : I'm having trouble getting a script to set a cookie. : : : : It works when I type the URL of the script into the browser and press : : enter.. it works that's way and a cookie is set. : : : : But when I place that script in a HTML page like this : : : : the cookie won't set. : : : : Is there something special you are supposed to do to set the cookie when : : executing the script like that? : : You must set the Cookie in the HTTP Headers that get sent first with a : web page, by using SSI to include your cookie_get.pl, you're too late : to get the cookies. If you don't want to write a CGI program for the : page, you could use JavaScript to handle the Cookies but then you : limit yourself on usefullness, since you don't really have much access : to the server side. I really should try to post to the list. :) : Casey West : : -- : Shooting yourself in the foot with Internet : You put your foot in your mouth, shoot it, then spam the bullet so : that everybody gets shot in the foot. Casey West -- If unix is the face of the future I wanna go back to quill pens. -- Joseph Snipp
RE: Cookies
Cookies are set in the HTTP header portion of the HTML response. When you run you include your script within the page, the HTTP header has already been sent. You need to set the cookie as a standalone page (though you can get cookies in included scripts) --A -Original Message- From: Brian Shoemaker [mailto:[EMAIL PROTECTED]] Sent: May 9, 2001 1:46 PM To: [EMAIL PROTECTED] Subject: Cookies I'm having trouble getting a script to set a cookie. It works when I type the URL of the script into the browser and press enter.. it works that's way and a cookie is set. But when I place that script in a HTML page like this the cookie won't set. Is there something special you are supposed to do to set the cookie when executing the script like that? Thanks! Brian Shoemaker
Re: Cookies
On Wed, 9 May 2001, Brian Shoemaker wrote: > I'm having trouble getting a script to set a cookie. > > It works when I type the URL of the script into the browser and press > enter.. it works that's way and a cookie is set. > > But when I place that script in a HTML page like this > > the cookie won't set. > > Is there something special you are supposed to do to set the cookie when > executing the script like that? You can't do it that way -- run the script directly and then redirect to your HTML page. -- Brett http://www.chapelperilous.net/btfwk/ Microbiology Lab: Staph Only!
Cookies
I'm having trouble getting a script to set a cookie. It works when I type the URL of the script into the browser and press enter.. it works that's way and a cookie is set. But when I place that script in a HTML page like this the cookie won't set. Is there something special you are supposed to do to set the cookie when executing the script like that? Thanks! Brian Shoemaker
RE: RE: Help with Perl (fwd)
On May 9, [EMAIL PROTECTED] said: >Somebody please help me uderstand the deal with "qq". I have run tests >on all three lines of code below and it turns out that #1 and #3 work >but #2 does not. I am under the impression that "qq" acts as double >quotes. So why doesn't #2 work isn't it the same as #1? NO COMPRENDE!!! >> 1. print qq/I said "Help me!!".\n/; >> >> 2. print "I said "Help me!!".\n"; >> >> 3. print "I said /"Help me!!/".\n"; #1 works, but #2 and #3 do not. I think you meant to use \" instead of /" in #3. qq() is double-quoted context, but it is a replacement for physical double-quotes. By using qq//, it's like / is now your quote. Just like "he said "hi" to me" is invalid, so is qq/he said /hi/ to me/ To get that to work, you'd need to backslash the quoting character: "he said \"hi\" to me" qq/he said \/hi\/ to me/ but that should be a sign that you should've chosen a different character. Using qq(), qq[], qq{}, or qq<> allows you to nest the quotes: qq(I think (since I'm ill) I won't go to class today.) -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/ Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/ Acacia Fraternity, Rensselaer Chapter. Brother #734
RE: RE: Help with Perl (fwd)
On Wed, 9 May 2001 [EMAIL PROTECTED] wrote: > Somebody please help me uderstand the deal with "qq". I have run tests > on all three lines of code below and it turns out that #1 and #3 work > but #2 does not. I am under the impression that "qq" acts as double > quotes. So why doesn't #2 work isn't it the same as #1? NO > COMPRENDE!!! Thanks, [EMAIL PROTECTED] > > > > 1. print qq/I said "Help me!!".\n/; > > > > 2. print "I said "Help me!!".\n"; > > > > 3. print "I said /"Help me!!/".\n"; qq is used so you don't need to escape nested double quotes in a string. In the second example, Perl sees the nested double quotes and thinks they match against the first set of double quotes. It would try to print "I said " Help me!! ".\n" Obviously the second line would would flag all kinds of errors, like barewords, no concatenation, etc. Using qq// helps in this regard, combat ambiguity, and aids in reability. -- Brett http://www.chapelperilous.net/btfwk/ Human kind cannot bear very much reality. -- T.S. Eliot, "Four Quartets: Burnt Norton"
RE: RE: Help with Perl (fwd)
Somebody please help me uderstand the deal with "qq". I have run tests on all three lines of code below and it turns out that #1 and #3 work but #2 does not. I am under the impression that "qq" acts as double quotes. So why doesn't #2 work isn't it the same as #1? NO COMPRENDE!!! Thanks, [EMAIL PROTECTED] > 1. print qq/I said "Help me!!".\n/; > > 2. print "I said "Help me!!".\n"; > > 3. print "I said /"Help me!!/".\n"; >
RE: Loading extra modules.
: > perl Makefile.PL : : make : : > make test : > make install {su'ed to root} When you do "make test" and you haven't done "make", "make" will be done automatically. -- tdk
Re: Loading extra modules.
: Apparently, even if I give PREFIX= as a command line param, you get the : following errors: : Skipping /home/tir/COMP/perl/modules/lib/site_perl/5.005/Date/Manip.pod (unchanged) This means that Perl didn't bother to install Manip.pod because there was one already there that was exactly the same as the one to be installed. (Presumably, you did the install twice?) : /home/tir/COMP/perl/modules//lib/5.00503/i386-linux/perllocal.pod: No such file or :directory : make: [doc_site_install] Error 1 (ignored) Not a big deal. perllocal.pod is where perl records module installations. It's for your information, really (you can read it with "perldoc perllocal"); perl doesn't use it for anything. This can be ignored. If you want to skip this message in the future, do "make pure_install" instead of "make install". So only one of these messages was an error, and it wasn't really important. The rest of the messages were just informational. -- tdk
Re: newbie: CPAN module usage.
Brett... Try 'ppm' at the command line. ___ C:\WINNT\Profiles\sneu\Desktop>ppm PPM interactive shell (2.1.2) - type 'help' for available commands. PPM> Commands: exit - leave the program. help [command]- prints this screen, or help on 'command'. install PACKAGES - installs specified PACKAGES. quit - leave the program. query [options] - query information about installed packages. remove PACKAGES - removes the specified PACKAGES from the system. search [options] - search information about available packages. set [options] - set/display current options. verify [options] - verifies current install is up to date. version - displays PPM version number PPM> Stephen Neu Internet Development Characterlink.net (630) 323-9800 ext. 235 "The camel was not designed to smell good. Neither was Perl." --Larry Wall - Original Message - From: "SS HK" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 09, 2001 12:09 PM Subject: newbie: CPAN module usage. > Hi, > > I would like to install some of the CPAN modules. How > can I do that. I am using ActivePerl on Windows. > > Any pointers would be greatly helpful. > > regards, > inssic. > > __ > Do You Yahoo!? > Yahoo! Auctions - buy the things you want at great prices > http://auctions.yahoo.com/ >
Re: newbie: CPAN module usage.
Brett... Try 'ppm' at the command line. ___ C:\WINNT\Profiles\sneu\Desktop>ppm PPM interactive shell (2.1.2) - type 'help' for available commands. PPM> Commands: exit - leave the program. help [command]- prints this screen, or help on 'command'. install PACKAGES - installs specified PACKAGES. quit - leave the program. query [options] - query information about installed packages. remove PACKAGES - removes the specified PACKAGES from the system. search [options] - search information about available packages. set [options] - set/display current options. verify [options] - verifies current install is up to date. version - displays PPM version number PPM> Stephen Neu Internet Development Characterlink.net (630) 323-9800 ext. 235 "The camel was not designed to smell good. Neither was Perl." --Larry Wall - Original Message - From: "SS HK" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 09, 2001 12:09 PM Subject: newbie: CPAN module usage. > Hi, > > I would like to install some of the CPAN modules. How > can I do that. I am using ActivePerl on Windows. > > Any pointers would be greatly helpful. > > regards, > inssic. > > __ > Do You Yahoo!? > Yahoo! Auctions - buy the things you want at great prices > http://auctions.yahoo.com/ >
Re: newbie: CPAN module usage.
On Wed, 9 May 2001, SS HK wrote: > I would like to install some of the CPAN modules. How > can I do that. I am using ActivePerl on Windows. You will need a C compiler in most cases. However, ActiveState has a lot of CPAN modules packaged via their PPM facility. You should consult their documentation on how to use it. -- Brett http://www.chapelperilous.net/btfwk/ Calm down, it's *only* ones and zeroes.
Re: newbie: CPAN module usage.
Brett... Try 'ppm' at the command line. ___ C:\WINNT\Profiles\sneu\Desktop>ppm PPM interactive shell (2.1.2) - type 'help' for available commands. PPM> Commands: exit - leave the program. help [command]- prints this screen, or help on 'command'. install PACKAGES - installs specified PACKAGES. quit - leave the program. query [options] - query information about installed packages. remove PACKAGES - removes the specified PACKAGES from the system. search [options] - search information about available packages. set [options] - set/display current options. verify [options] - verifies current install is up to date. version - displays PPM version number PPM> Stephen Neu Internet Development Characterlink.net (630) 323-9800 ext. 235 "The camel was not designed to smell good. Neither was Perl." --Larry Wall - Original Message - From: "SS HK" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 09, 2001 12:09 PM Subject: newbie: CPAN module usage. > Hi, > > I would like to install some of the CPAN modules. How > can I do that. I am using ActivePerl on Windows. > > Any pointers would be greatly helpful. > > regards, > inssic. > > __ > Do You Yahoo!? > Yahoo! Auctions - buy the things you want at great prices > http://auctions.yahoo.com/ >
Re: Very beginner question
On Wed, 9 May 2001 [EMAIL PROTECTED] wrote: > I feel strange putting such a simple question on this list, but then > again, that is why I did not join the experts list. > > Any how, if I have a file called "try.txt" with the following line: > > (name = john) > > if I am trying to just extract "john" for the value $b, why would the > following script not work. I thought it would take bothIt returns the > full (name=john) > > #!user/local/bin/perl -w > > open TRY , "try.txt"; > > while () { > (my $b=$_) =~ s/^(\() (\w+)/$2/; > print $b; > } The substitution is unnecessary: if( m|\(.+\s*=\s*(.+)\)| ) { print "$1\n" } -- Brett http://www.chapelperilous.net/btfwk/ jogger, n.: An odd sort of person with a thing for pain.
Re: Very beginner question
On Wed, May 09, 2001 at 12:27:26PM -0500, John Joseph Trammell wrote: : On Wed, May 09, 2001 at 01:50:24PM -0400, [EMAIL PROTECTED] wrote: : > #!user/local/bin/perl -w : > : > open TRY , "try.txt"; : > : > while () { : > (my $b=$_) =~ s/^(\() (\w+)/$2/; : > print $b; : > } : > : > Thank you for humiliating me with this simple question. For the record, I'd like everyone to know that humiliation does not rub well with this list. Please don't feel this way when posting. "One who asks a question is a fool for 5 mintues, one who never asks is a fool for life." or something like that. : Any time. : : #!/usr/bin/perl -w : use strict; : open(TRY,"try.txt") or die qq[unable to open "try.txt": $!]; : while () : { : my ($b) = /\(\w+ = (\w+)\)/; : print $b, "\n"; : } : __END__ : (name = john) : : -- : Just Another Perl Hacker. Casey West -- "If I had thought about it, I wouldn't have done the experiment. The literature was full of examples that said you can't do this." -- Spencer Silver on the work that led to the unique adhesives for 3-M "Post-It" Notepads.
Re: Loading extra modules.
> > Be careful -- you can't just move modules into a directory and expect them > to work, since some depend on loading native code shared libraries. Brett was right. I tried installing it, but wasn't successful. I then got the Sys Admin folks to install it, and it went just fine!! Apparently, even if I give PREFIX= as a command line param, you get the following errors: Manifying blib/man3/Date::Manip.3 Skipping /home/tir/COMP/perl/modules/lib/site_perl/5.005/Date/Manip.pm (unchanged) Skipping /home/tir/COMP/perl/modules/lib/site_perl/5.005/Date/Manip.pod (unchanged) Installing /home/tir/COMP/perl/modules/lib/site_perl/5.005/Date/lib/perl5/site_perl/5.005/Date/Manip.pm Installing /home/tir/COMP/perl/modules/lib/site_perl/5.005/Date/lib/perl5/site_perl/5.005/Date/Manip.pod Installing /home/tir/COMP/perl/modules/lib/site_perl/5.005/perl5/site_perl/5.005/i386-linux/auto/Date/Manip/.packlist Skipping /home/tir/COMP/perl/modules/lib/perl5/man/man3/Date::Manip.3 (unchanged) Installing /home/tir/COMP/perl/modules/lib/perl5/man/man3/lib/perl5/man/man3/Date::Manip.3 Writing /home/tir/COMP/perl/modules//lib/site_perl/5.005/i386-linux/auto/Date/Manip/.packlist /bin/sh: /home/tir/COMP/perl/modules//lib/5.00503/i386-linux/perllocal.pod: No such file or directory make: [doc_site_install] Error 1 (ignored) Appending installation info to /home/tir/COMP/perl/modules//lib/5.00503/i386-linux/perllocal.pod I don't know what to make of this!! Thanks anyway, -tir
newbie: CPAN module usage.
Hi, I would like to install some of the CPAN modules. How can I do that. I am using ActivePerl on Windows. Any pointers would be greatly helpful. regards, inssic. __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Re: Very beginner question
- Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 09, 2001 7:50 PM Subject: Very beginner question > > if I am trying to just extract "john" for the value $b, why would the > following script not work. I thought it would take bothIt returns the > full (name=john) > while () { > (my $b=$_) =~ s/^(\() (\w+)/$2/; > print $b; > } you are matching a "(" at the beginning of the line, followed by a whitespace followed by one or more word characters. As you can see, there is no such thing in yuor input. try this: # remove any characters follwed by an erqual sign and an optional whitespace or a right bracket from $_ while () { s/.*=\s?|\)//g; print "$_\n"; }
Re: Very beginner question
On Wed, May 09, 2001 at 01:50:24PM -0400, [EMAIL PROTECTED] wrote: > #!user/local/bin/perl -w > > open TRY , "try.txt"; > > while () { > (my $b=$_) =~ s/^(\() (\w+)/$2/; > print $b; > } > > Thank you for humiliating me with this simple question. Any time. #!/usr/bin/perl -w use strict; open(TRY,"try.txt") or die qq[unable to open "try.txt": $!]; while () { my ($b) = /\(\w+ = (\w+)\)/; print $b, "\n"; } __END__ (name = john) -- Just Another Perl Hacker.
Re: Very beginner question
I don't quite understand what your regex is intended to do, but if you try tr/()//; s/^.+=//; it should return John as you intend. The tr will remove the parentheses and the substitution will match everything up to the = and substitute it with nothing. alternatively you could do: tr/()// ($field,$value) = split /=/, $_ Good luck At 01:50 PM 5/9/01 -0400, [EMAIL PROTECTED] wrote: >I feel strange putting such a simple question on this list, but then >again, that is why I did not join the experts list. > >Any how, if I have a file called "try.txt" with the following line: > >(name = john) > >if I am trying to just extract "john" for the value $b, why would the >following script not work. I thought it would take bothIt returns the >full (name=john) > >#!user/local/bin/perl -w > >open TRY , "try.txt"; > >while () { > (my $b=$_) =~ s/^(\() (\w+)/$2/; > print $b; >} > > >Thank you for humiliating me with this simple question. > >Olivier >"The one who still has a long way to go with Perl" Peter Cline Inet Developer New York Times Digital
Re: Very beginner question
On May 9, [EMAIL PROTECTED] said: >(name = john) > >if I am trying to just extract "john" for the value $b, why would the >following script not work. I thought it would take bothIt returns the >full (name=john) Let's run your regex through the regex explainer: > (my $b=$_) =~ s/^(\() (\w+)/$2/; NODE EXPLANATION -- (?-imsx: group, but do not capture (case-sensitive) (with ^ and $ matching normally) (with . not matching \n) (matching whitespace and # normally): -- ^the beginning of the string -- (group and capture to \1: -- \( '(' -- )end of \1 -- ' ' -- (group and capture to \2: -- \w+ word characters (a-z, A-Z, 0-9, _) (1 or more times (matching the most amount possible)) -- )end of \2 -- )end of grouping -- You can see that it's matching a '(', and then a ' '. You don't have a space after the ( though. :( Perhaps you want to use: while () { my ($name) = /^\(\w+ = (\w+)\)$/; print "got: $name\n"; } That regex matches the (, and then some "word", then " = ", and then saves the next "word" it finds. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/ Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/ Acacia Fraternity, Rensselaer Chapter. Brother #734
Very beginner question
I feel strange putting such a simple question on this list, but then again, that is why I did not join the experts list. Any how, if I have a file called "try.txt" with the following line: (name = john) if I am trying to just extract "john" for the value $b, why would the following script not work. I thought it would take bothIt returns the full (name=john) #!user/local/bin/perl -w open TRY , "try.txt"; while () { (my $b=$_) =~ s/^(\() (\w+)/$2/; print $b; } Thank you for humiliating me with this simple question. Olivier "The one who still has a long way to go with Perl"
RE: IDE for perl?
At 11:14 AM 5/9/01 -0600, blowther wrote: >I think it's pretty clear, given that the poster is asking for feedback that >they are looking for options. > >Disclaimer: I don't work for free. Sorry, I worded it poorly. I was responding to the original poster and did it as a followup to your message where I should have done it to theirs. >-Original Message- >From: Peter Scott [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, May 09, 2001 10:53 AM >To: [EMAIL PROTECTED] >Subject: RE: IDE for perl? > > >At 10:41 AM 5/9/01 -0600, blowther wrote: > >I recommend wscite when I teach perl classes. The code highlighting is > >pretty good. No inline debugger tho. We use ptkdb for graphical >debugging. > >--all of these are free.-- > >I think it's pretty clear, given the requirement for project directories, >and group environment, that the poster should take a look at Activestate >Visual Perl (http://aspn.activestate.com/ASPN/Downloads/VisualPerl/), since >it allows Visual Studio to provide those features. Since it sounds as >though money's available, they may want to check out their ASPN Perl >package also (http://www.activestate.com/Products/Productivity/ASPN_Perl/). > >Disclaimer: I don't work for ActiveState. > > >-Original Message- > >From: Rod Suter [mailto:[EMAIL PROTECTED]] > >Sent: Wednesday, May 09, 2001 8:19 AM > >To: [EMAIL PROTECTED] > >Subject: IDE for perl? > > > > > >I'm using perl through emacs, but I want to bring along some people on > >NT4.0. They're accustomed to Visual Studio, and want IDE features, such as > >project directories, global search and replace, debugger linking, source > >code error hilighting, etc. Can anyone suggest a good group environment for > >developing perl? My first urge is to set up Ultra-Edit with some >appropriate > >customization. > >-- >Peter Scott >Pacific Systems Design Technologies >http://www.perldebugged.com -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com
RE: Loading extra modules.
> perl Makefile.PL make > make test > make install {su'ed to root}
Re: Loading extra modules.
On Wed, 9 May 2001, Tirthankar C.P wrote: > Folks, how do I load extra modules? I got Date::Manip today, and I know I > should be putting it in the search-path of perl (@INC ?), but how do I do > it? Can I get a small code snippet? > > I do not have su privileges on the machine I work, and would like the > search-path to have my modules dir, $HOME/perlmodules in it. Be careful -- you can't just move modules into a directory and expect them to work, since some depend on loading native code shared libraries. If you have a module you want to use, you can do something like: use lib '/path/to/modules'; #MyModule.pm is in this directory use MyModule; -- Brett http://www.chapelperilous.net/btfwk/ Before destruction a man's heart is haughty, but humility goes before honour. -- Psalms 18:12
Re: mv'ing a file from within perl (w/out /bin/mv)
On Wed, 9 May 2001, Shawn wrote: > I just want an efficient mv subroutine or module which has such a thing, > but none of the File::* things seem to have mv. Try File::Copy -- it has a move function. -- Brett http://www.chapelperilous.net/btfwk/ Gravity: What you get when you eat too much and too fast.
Re: Loading extra modules.
: Folks, how do I load extra modules? I got Date::Manip today, and I know I : should be putting it in the search-path of perl (@INC ?), but how do I do : it? Can I get a small code snippet? : : I do not have su privileges on the machine I work, and would like the : search-path to have my modules dir, $HOME/perlmodules in it. Try this (as you): perl Makefile.PL PREFIX=$HOME/perlmodules make make test make install Then in your script: use lib '$HOME/perlmodules'; # replace $HOME with the location of your directory -- tdk
RE: Loading extra modules.
If you got it in a tar'ed package, it will come with a Makefile.PL script. The general procedure is: perl Makefile.PL make test make install {su'ed to root} If you didn't get the tar'ed package, and just have .pm, then I would recommend getting the tar'ed package instead. This would vary somewhat if you're on a Windows NT box. -Original Message- From: Tirthankar C.P [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 09, 2001 11:44 AM To: [EMAIL PROTECTED] Subject: Loading extra modules. Folks, how do I load extra modules? I got Date::Manip today, and I know I should be putting it in the search-path of perl (@INC ?), but how do I do it? Can I get a small code snippet? I do not have su privileges on the machine I work, and would like the search-path to have my modules dir, $HOME/perlmodules in it. TIA, -tir
Re: mv'ing a file from within perl (w/out /bin/mv)
On May 9, Shawn said: >I just want an efficient mv subroutine or module which has such a thing, >but none of the File::* things seem to have mv. > >I would rather not shell out 1 times just to, in the vast majority >of cases, move a file from on dir to another in the same fs. If the standard rename() function isn't good enough, File::Copy also has a move() function. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/ Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/ Acacia Fraternity, Rensselaer Chapter. Brother #734
Re: mv'ing a file from within perl (w/out /bin/mv)
On Wed, May 09, 2001 at 12:13:54PM -0500, Shawn wrote: > I just want an efficient mv subroutine or module which has such a thing, > but none of the File::* things seem to have mv. I think you'll be pleasantly surprised if you look in File::Copy. -- I don't know what the hell is going on dude, but this suspension gives me more time for fraggin'. Yee haw!
Re: mv'ing a file from within perl (w/out /bin/mv)
At 12:13 PM 5/9/01 -0500, Shawn wrote: >I just want an efficient mv subroutine or module which has such a thing, >but none of the File::* things seem to have mv. > >I would rather not shell out 1 times just to, in the vast majority >of cases, move a file from on dir to another in the same fs. > >Can someone help? % perldoc -f rename rename OLDNAME,NEWNAME Changes the name of a file; an existing file NEWNAME will be clobbered. Returns true for success, false otherwise. Behavior of this function varies wildly depending on your system implementation. For example, it will usually not work across file system boundaries, even though the system mv command sometimes compensates for this. Other restrictions include whether it works on directories, open files, or pre-existing files. Check the perlport manpage and either the rename(2) manpage or equivalent system documentation for details. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com
Re: mv'ing a file from within perl (w/out /bin/mv)
: I just want an efficient mv subroutine or module which has such a thing, : but none of the File::* things seem to have mv. perldoc -f rename -- tdk
Re: IDE for perl?
On Wed, 9 May 2001, Rod Suter wrote: > I'm using perl through emacs, but I want to bring along some people on > NT4.0. They're accustomed to Visual Studio, and want IDE features, > such as project directories, global search and replace, debugger > linking, source code error hilighting, etc. Can anyone suggest a good > group environment for developing perl? My first urge is to set up > Ultra-Edit with some appropriate customization. Doesn't ActiveState have a VisualPerl? There's also Komodo, which is built on Mozilla. Of course, you can also use emacs on Windows -- it has everything you describe (syntax highlighting, search and replace, etc). -- Brett http://www.chapelperilous.net/btfwk/ Hubbard's Law: Don't take life too seriously; you won't get out of it alive.
Loading extra modules.
Folks, how do I load extra modules? I got Date::Manip today, and I know I should be putting it in the search-path of perl (@INC ?), but how do I do it? Can I get a small code snippet? I do not have su privileges on the machine I work, and would like the search-path to have my modules dir, $HOME/perlmodules in it. TIA, -tir
RE: IDE for perl?
I think it's pretty clear, given that the poster is asking for feedback that they are looking for options. Disclaimer: I don't work for free. -Original Message- From: Peter Scott [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 09, 2001 10:53 AM To: [EMAIL PROTECTED] Subject: RE: IDE for perl? At 10:41 AM 5/9/01 -0600, blowther wrote: >I recommend wscite when I teach perl classes. The code highlighting is >pretty good. No inline debugger tho. We use ptkdb for graphical debugging. >--all of these are free.-- I think it's pretty clear, given the requirement for project directories, and group environment, that the poster should take a look at Activestate Visual Perl (http://aspn.activestate.com/ASPN/Downloads/VisualPerl/), since it allows Visual Studio to provide those features. Since it sounds as though money's available, they may want to check out their ASPN Perl package also (http://www.activestate.com/Products/Productivity/ASPN_Perl/). Disclaimer: I don't work for ActiveState. >-Original Message- >From: Rod Suter [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, May 09, 2001 8:19 AM >To: [EMAIL PROTECTED] >Subject: IDE for perl? > > >I'm using perl through emacs, but I want to bring along some people on >NT4.0. They're accustomed to Visual Studio, and want IDE features, such as >project directories, global search and replace, debugger linking, source >code error hilighting, etc. Can anyone suggest a good group environment for >developing perl? My first urge is to set up Ultra-Edit with some appropriate >customization. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com
mv'ing a file from within perl (w/out /bin/mv)
I just want an efficient mv subroutine or module which has such a thing, but none of the File::* things seem to have mv. I would rather not shell out 1 times just to, in the vast majority of cases, move a file from on dir to another in the same fs. Can someone help? -- Hob Goblin [EMAIL PROTECTED] "... the establishment defends itself by complicating everything to the point of incomprehensibility." - Sir Fred Hoyle
RE: IDE for perl?
At 10:41 AM 5/9/01 -0600, blowther wrote: >I recommend wscite when I teach perl classes. The code highlighting is >pretty good. No inline debugger tho. We use ptkdb for graphical debugging. >--all of these are free.-- I think it's pretty clear, given the requirement for project directories, and group environment, that the poster should take a look at Activestate Visual Perl (http://aspn.activestate.com/ASPN/Downloads/VisualPerl/), since it allows Visual Studio to provide those features. Since it sounds as though money's available, they may want to check out their ASPN Perl package also (http://www.activestate.com/Products/Productivity/ASPN_Perl/). Disclaimer: I don't work for ActiveState. >-Original Message- >From: Rod Suter [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, May 09, 2001 8:19 AM >To: [EMAIL PROTECTED] >Subject: IDE for perl? > > >I'm using perl through emacs, but I want to bring along some people on >NT4.0. They're accustomed to Visual Studio, and want IDE features, such as >project directories, global search and replace, debugger linking, source >code error hilighting, etc. Can anyone suggest a good group environment for >developing perl? My first urge is to set up Ultra-Edit with some appropriate >customization. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com
Re: gzip or Compress::Zlib
I won't comment on what is 'better'. I like using the Perl modules, that is what they are there for (and I have never had any problems). If you want to know if you can use Compress::Zlib, please read the documentation which comes with it and see if it fits your needs. I suggest you do that with all your options, see how they fit into what you wish to do.. benchmark if you need to, and form your own educated opinion to what way is 'better' for your project. Cheers, Kevin On Wed, May 09, 2001 at 11:38:00AM -0500, Kailash Subramanian ([EMAIL PROTECTED]) spew-ed forth: > > > > Hi Kevin, > Thanks for your info. Somebody in this mailing list > previously told me to use UNIX tar utility rather than Archive::Tar. > So, I decided to use UNIX tar. But now I want to compress the tar file > and that's the reason for this question. But it looks like you are > suggesting to use perl Archive::Tar utility to tar the files. Can I > not just use the Compress utility of perl without Archive::Tar if it > is better that UNIX gzip ? > > Thx > Kailash > > > > From: [EMAIL PROTECTED] AT INTERNET on 05/09/2001 12:23 PM > > To: Kailash Subramanian/ATL/ALLTELCORP > cc: [EMAIL PROTECTED] AT INTERNET@CCMAIL > > Subject: Re: gzip or Compress::Zlib > > > Hi Kailash, > > If you are doing the compression from with a Perl script, use > Archive::Tar > (which uses Compress::Zlib in the background). After installing the > modules, > use the following commands to see their documentation (which will give > you the > basic syntax): > > perldoc Archive::Tar > perldoc Compress::Zlib > > Cheers, > Kevin > > On Wed, May 09, 2001 at 12:23:16PM -0400, > [EMAIL PROTECTED] (Kailas > [EMAIL PROTECTED]) spew-ed forth: > > > > > > > > Hello, > > Can somebody advice on whether to use UNIX gzip or the perl > Compress::Zli > b > > for compressing a tar file. If it is going to be Compress::Zlib, I > would > > appreciate if somebody can give me a basic syntax. > > > > Thx > > Kailash > > > > > > -- > [Writing CGI Applications with Perl - http://perlcgi-book.com] > Never laugh at a live dragon. > -- The Hobbit > > > > > -- [Writing CGI Applications with Perl - http://perlcgi-book.com] Number one ain't you... You ain't even number two. -- Frank Zappa
RE: IDE for perl?
I recommend wscite when I teach perl classes. The code highlighting is pretty good. No inline debugger tho. We use ptkdb for graphical debugging. --all of these are free.-- -Original Message- From: Rod Suter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 09, 2001 8:19 AM To: [EMAIL PROTECTED] Subject: IDE for perl? I'm using perl through emacs, but I want to bring along some people on NT4.0. They're accustomed to Visual Studio, and want IDE features, such as project directories, global search and replace, debugger linking, source code error hilighting, etc. Can anyone suggest a good group environment for developing perl? My first urge is to set up Ultra-Edit with some appropriate customization.
Re: Process a single field file
At 05:49 PM 5/9/01 +1000, you wrote: >Hi very new to perl... am getting some books asap. Looks like Lincoln Stein's "Network Programming with Perl" would be apposite... >I am writing a script to create named.conf records from a single field >text file > >eg, domain.fle >domain1.com >domain2.net >domain3.org > >and then create a named.conf entry from; > >$namedconf="/etc/namedb/named.conf" ; >$namednow="/etc/namedb/named.conf.$now" ; >$namedtmp="/etc/namedb/named.conf.tmp" ; > >unless (-e $namedconf) { die "$namedconf does not exist!" } You'll probably want to put a \n in that die. >open (NAMEDNOW, "> $namednow") || die "Cannot open $namedtmp for >writing\n\n" ; Er, the file in the die is not the same as the one in the open... >open (NAMED, $namedconf) || die "Cannot open $namedconf for reading\n\n" ; >Lock::wlock(NAMED); > >while () { >if ((/nextprimary/) && ($domaintype eq "primary")) { >print NAMEDNOW < >zone "$domainname" { > type master; > allow-query { any; } ; > file "zones/$domainname"; >}; > >ENUF > >Newbie please be gentle... You're asking for a critique? The above code is incomplete, so that's hard to do. I don't see a -w/use warnings or use strict in there, so those would be essential to add. Also, the script at least as it appeared to me didn't have indentation inside blocks; pretty code layout is far more important than most people think. Otherwise, style and usage are fine. I'm not familiar with the Lock module you appear to be using, and I don't see it on CPAN. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com
Re: gzip or Compress::Zlib
Hi Kevin, Thanks for your info. Somebody in this mailing list previously told me to use UNIX tar utility rather than Archive::Tar. So, I decided to use UNIX tar. But now I want to compress the tar file and that's the reason for this question. But it looks like you are suggesting to use perl Archive::Tar utility to tar the files. Can I not just use the Compress utility of perl without Archive::Tar if it is better that UNIX gzip ? Thx Kailash From: [EMAIL PROTECTED] AT INTERNET on 05/09/2001 12:23 PM To: Kailash Subramanian/ATL/ALLTELCORP cc: [EMAIL PROTECTED] AT INTERNET@CCMAIL Subject: Re: gzip or Compress::Zlib Hi Kailash, If you are doing the compression from with a Perl script, use Archive::Tar (which uses Compress::Zlib in the background). After installing the modules, use the following commands to see their documentation (which will give you the basic syntax): perldoc Archive::Tar perldoc Compress::Zlib Cheers, Kevin On Wed, May 09, 2001 at 12:23:16PM -0400, [EMAIL PROTECTED] (Kailas [EMAIL PROTECTED]) spew-ed forth: > > > > Hello, > Can somebody advice on whether to use UNIX gzip or the perl Compress::Zli b > for compressing a tar file. If it is going to be Compress::Zlib, I would > appreciate if somebody can give me a basic syntax. > > Thx > Kailash > > -- [Writing CGI Applications with Perl - http://perlcgi-book.com] Never laugh at a live dragon. -- The Hobbit
Re: gzip or Compress::Zlib
Hi Kailash, If you are doing the compression from with a Perl script, use Archive::Tar (which uses Compress::Zlib in the background). After installing the modules, use the following commands to see their documentation (which will give you the basic syntax): perldoc Archive::Tar perldoc Compress::Zlib Cheers, Kevin On Wed, May 09, 2001 at 12:23:16PM -0400, [EMAIL PROTECTED] ([EMAIL PROTECTED]) spew-ed forth: > > > > Hello, > Can somebody advice on whether to use UNIX gzip or the perl Compress::Zlib > for compressing a tar file. If it is going to be Compress::Zlib, I would > appreciate if somebody can give me a basic syntax. > > Thx > Kailash > > -- [Writing CGI Applications with Perl - http://perlcgi-book.com] Never laugh at a live dragon. -- The Hobbit
gzip or Compress::Zlib
Hello, Can somebody advice on whether to use UNIX gzip or the perl Compress::Zlib for compressing a tar file. If it is going to be Compress::Zlib, I would appreciate if somebody can give me a basic syntax. Thx Kailash
RE: IDE for perl?
ActiveState Komodo is nice for those needing an IDE - http://www.ActiveState.com. I prefer Emacs and use it at home, but I work in a M$ shop. John Gilger Technical Writer Acres Gaming, Inc. 702.914.5585 -Original Message- From: Rod Suter [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 09, 2001 07:19 AM To: [EMAIL PROTECTED] Subject: IDE for perl? I'm using perl through emacs, but I want to bring along some people on NT4.0. They're accustomed to Visual Studio, and want IDE features, such as project directories, global search and replace, debugger linking, source code error hilighting, etc. Can anyone suggest a good group environment for developing perl? My first urge is to set up Ultra-Edit with some appropriate customization.
Re: IDE for perl?
At 10:19 AM 09-05-01 -0400, Rod Suter wrote: >I'm using perl through emacs, but I want to bring along some people on >NT4.0. They're accustomed to Visual Studio, and want IDE features, such >as project directories, global search and replace, debugger linking, >source code error hilighting, etc. Can anyone suggest a good group >environment for developing perl? My first urge is to set up Ultra-Edit >with some appropriate customization. EditPlus is very good. Joe Yates
Re: IDE for perl?
PerlBuilder by SolutionSoft is a good product. Also, ActiveState has a Perl IDE as well. I have not used the ActiveState one yet though brent "Rod Suter" <[EMAIL PROTECTED]> Sent by: To: <[EMAIL PROTECTED]> beginners-return-1125-Brent_Michalski=mastercard.cocc: [EMAIL PROTECTED] Subject: IDE for perl? 05/09/01 09:19 AM I'm using perl through emacs, but I want to bring along some people on NT4.0. They're accustomed to Visual Studio, and want IDE features, such as project directories, global search and replace, debugger linking, source code error hilighting, etc. Can anyone suggest a good group environment for developing perl? My first urge is to set up Ultra-Edit with some appropriate customization.
IDE for perl?
I'm using perl through emacs, but I want to bring along some people on NT4.0. They're accustomed to Visual Studio, and want IDE features, such as project directories, global search and replace, debugger linking, source code error hilighting, etc. Can anyone suggest a good group environment for developing perl? My first urge is to set up Ultra-Edit with some appropriate customization.
Re: beginner here - with basic cgi trouble
"Brett W. McCoy" wrote: > > On Tue, 8 May 2001, Chip Wiegand wrote: > > > - server log - > > [error](2)No such file or directory. exec of /usr/local/apache/cgi-bin/ > > formparser.cgi failed > > [error][192.168.1.8] Premature end of script headers: /usr/local/apache/ > > cgi-bin/formparser.cgi > > - I see the file DOES exist as formparser.cgi in the directory path shown > > in the errors. > > - I run perl -c formparser.cgi and get the response Syntax OK > > It seems to me that the problem isn't that it can't find formparser.cgi, > but there is some other file that formparser.cgi depends on to run that > can't be found (the perl executable perhaps?). Checking the syntax isn't > enough -- you need to see if the program will *run*. If it's executable, > you should be able to at least do ./formparser.cgi and see where it's > failing. > > -- Brett >http://www.chapelperilous.net/btfwk/ > > Gibble, Gobble, we ACCEPT YOU ... Chip, Briet is right. But also do perl -d ./formpargser.cgi that will put you in debug state and should bring up a prompt. See below: Loading DB routines from perl5db.pl version 1.0402 Emacs support available. Enter h or `h h' for help. main::(suggestion.cgi:6): $mailprog = '/usr/lib/sendmail'; DB<1> The DB<1> is a prompt and by type and N means to step thru the code watch it execute. That may also help trouble shoot the problem further. -- *** Phillip B. Bruce *** *** http://pbbruce.home.mindspring.com *** *** [EMAIL PROTECTED] *** *** *** *** "Have you ever noticed? Anybody going slower than*** *** you is an idiot, and anyone going faster than you*** *** is a maniac." - George Carlin***
Re: Regexp: Grouping and replacing with an unknown number of groups
On Wed, 9 May 2001, Craig Moynes/Markham/IBM wrote: > I know there are plenty of wonderful Date manipulators (Date::Calc would > simply my life unimaginably) but I am still waiting to hear back from our > Legal Dept. regarding the use of the modules. I know that I should be > allowed to use them considering the modules found as part of perl often > come from CPAN anyways yet I am stuck in the mud of bureaucracy. :) Why does your legal department have an issue with the use of Perl modules? -- Brett http://www.chapelperilous.net/btfwk/ Yes, but every time I try to see things your way, I get a headache.
Re: Regexp: Grouping and replacing with an unknown number of groups
Thanks, I know there are plenty of wonderful Date manipulators (Date::Calc would simply my life unimaginably) but I am still waiting to hear back from our Legal Dept. regarding the use of the modules. I know that I should be allowed to use them considering the modules found as part of perl often come from CPAN anyways yet I am stuck in the mud of bureaucracy. :) - Craig Moynes Internship Student netCC Development IBM Global Services, Canada Tel: (905) 316-3486 [EMAIL PROTECTED] Matt Cauthorn cc: Subject: Re: Regexp: Grouping and replacing with an unknown number of 05/08/01 09:38groups PM Not sure if this will help you at this point, but I strongly recommend the Date::Manip module for anything involving parsing dates. It does everything you can imagine with dates and more. Tell it to parse your dates, and boom you can print them however you want, get differences, etc. There are plenty of other date mods on CPAN as well, but I've used Date::Manip and can say that it is awesome. Check it out. --- Craig Moynes/Markham/IBM <[EMAIL PROTECTED]> wrote: > Continuing with the problems for my 'date formatting' script. > > I am reading in a complete record from a logfile. I check to see if the > regexp matches to something inside the record. > Then I want to find the what each grouped mini-regexp matched up with in > the monster one at the bottom of the email. > > The number of mini-regexp differs depending on the date format line the > user enters. So i find out how make keys there are (thus the number of > mini-regexps) > and try to construct a string that will print out whatever the mini-regexp > matched up with. But of course it doesn't work ;) > > > $completeRec = "[Wed Aug 2 16:00:02 2000] [notice] caught SIGTERM, > shutting down"; > my $numOfKeys = keys %{$self->{DF_TOKENS}}; > for ( $counter = 1; $counter < $numOfKeys; $counter++) > { > $replaceString.="\$$counter "; > } > my $values = $completeRec; > > $values =~ s/.*$self->{DF_REGEXP}.*/$replaceString/g; > print "$values\n"; > > > > Where $self->{DF_REGEXP} = something like : > (?-xism:((?-xism:Mon|Tue|Wed|Thu|Fri|Sat|Sun))) (?-xism:((? > -xism:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))) (?-xism:((? -xism: > [ ][1-9]|[1-2][0-9]|3[0-1]))) (?-xism:((?-xism:[01][0-9]|2[0-3]))):(? -xism: > ((?-xism:[0-5][0-9]))):(?-xism:((?-xism:[0-5][0-9]))) (?-xism:((? > -xism:[0-9]{4}))) > > > This prints out something like: > $1 $2 $3 $4 $5 > > for each record. Which is not to useful ;) > > However if I change the "$replaceString" to $1 $2 $3 etc it works > perfectly. > So what are my options guys and gals ? > > > - > Craig Moynes > Internship Student > netCC Development > IBM Global Services, Canada > Tel: (905) 316-3486 > [EMAIL PROTECTED] > > __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Re: beginner here - with basic cgi trouble
On Tue, 8 May 2001, Chip Wiegand wrote: > - server log - > [error](2)No such file or directory. exec of /usr/local/apache/cgi-bin/ > formparser.cgi failed > [error][192.168.1.8] Premature end of script headers: /usr/local/apache/ > cgi-bin/formparser.cgi > - I see the file DOES exist as formparser.cgi in the directory path shown > in the errors. > - I run perl -c formparser.cgi and get the response Syntax OK It seems to me that the problem isn't that it can't find formparser.cgi, but there is some other file that formparser.cgi depends on to run that can't be found (the perl executable perhaps?). Checking the syntax isn't enough -- you need to see if the program will *run*. If it's executable, you should be able to at least do ./formparser.cgi and see where it's failing. -- Brett http://www.chapelperilous.net/btfwk/ Gibble, Gobble, we ACCEPT YOU ...
Re: Process a single field file
Can you sepcify what your problem is, exactly. At a first glance your code looks fine... cr On Wed, 09 May 2001 17:49:16 +1000, Clayton Winter said: > Hi very new to perl... am getting some books asap. > > I am writing a script to create named.conf records from a single field > text file > > eg, domain.fle > domain1.com > domain2.net > domain3.org > > and then create a named.conf entry from; > > $namedconf="/etc/namedb/named.conf" ; > $namednow="/etc/namedb/named.conf.$now" ; > $namedtmp="/etc/namedb/named.conf.tmp" ; > > unless (-e $namedconf) { die "$namedconf does not exist!" } > > open (NAMEDNOW, "> $namednow") || die "Cannot open $namedtmp for > writing\n\n" ; > open (NAMED, $namedconf) || die "Cannot open $namedconf for reading\n\n" ; > Lock::wlock(NAMED); > > while () { > if ((/nextprimary/) && ($domaintype eq "primary")) { > print NAMEDNOW < > zone "$domainname" { > type master; > allow-query { any; } ; > file "zones/$domainname"; > }; > > ENUF > > Newbie please be gentle... > >
Re: Perl and WindowsNT
At 12:42 PM 08-05-01 -0400, Carl Rogers wrote: >Sorry if this is a dumb question.. (I know, there is no such thing as a >dumb question- only questions asked by dumb people:) > >I used the opendir() function in my Perl script to point to a folder with >200+ text files for the purpose of extracting data from each file. > >If I run the script with opendir/readdir pointing to a directory on a >shared drive, I'll get to a point where Perl tells me "Can't open file- no >such file or directory" This may be a dumb answer, but, here goes: Are you adding the path to the file name? opendir() gives you plain file names, you have to add the path to them to open them. my $sPath = ...any path opendir(DIR, $sPath); # Get all files in folder my @asFiles = grep { -f "$sPath$_" } readdir(DIR); closedir DIR; foreach my $sFile (@asFiles) { my $sPathFileName = "$sPath\\$sFile"; open INFILE, "<$sPathFileName"; ... close(INFILE); } Hope that helps. Joe
Re: microsoft sql2000
At 04:46 PM 08-05-01 -0700, you wrote: >Hello perl friends. I need to know if perl works with microsoft sql2000. if >it does, which module do i need to get? thanks I use DBI. 1. Set up the database you want to use as a 'Data Source' (Administrative Tools| Data Sources (ODBC)), 2. Then... use DBI; my $dbh = DBI->connect('dbi:ODBC:DATA_SOURCE_NAME', 'USER_NAME', 'PASSWORD'); ...do your stuff $dbh->disconnect; Joe Yates
Process a single field file
Hi very new to perl... am getting some books asap. I am writing a script to create named.conf records from a single field text file eg, domain.fle domain1.com domain2.net domain3.org and then create a named.conf entry from; $namedconf="/etc/namedb/named.conf" ; $namednow="/etc/namedb/named.conf.$now" ; $namedtmp="/etc/namedb/named.conf.tmp" ; unless (-e $namedconf) { die "$namedconf does not exist!" } open (NAMEDNOW, "> $namednow") || die "Cannot open $namedtmp for writing\n\n" ; open (NAMED, $namedconf) || die "Cannot open $namedconf for reading\n\n" ; Lock::wlock(NAMED); while () { if ((/nextprimary/) && ($domaintype eq "primary")) { print NAMEDNOW <
Re: getting values from a called subroutine
to mr meltzer, mr cline, and mr mccoy of the [EMAIL PROTECTED] list: Thank You!!! that was it! i remember looking at return function before, briefly, but for some reason had thought it was only for working within control loops... please, don't ask me why, it seems stupid to me, too, now... but yep, that was it. in fact, that was the final piece of the puzzle... thanks to you you guys, my program is now running with all the basic functions i wanted in it (more will come in later releases, i'm sure), and without any errors. it isn't pretty. in fact, it could be called down right ugly (both the interface and the code), but after a couple of months pulling my hair out over a problem, solving it, then only to come accross another, it can wait a little while... woo-hoo! break out the champaigne, slice up the tallcake, and watch the female dancers pop out of it (maybe not in that order, though). -- /\--- Adam Theo --- //\\ Theoretic Solutions (www.Theoretic.com) /\ Software, Politics, and Advocacy /--||--\ email: [EMAIL PROTECTED] AIM: Adam Theo 2000 ||jabber: [EMAIL PROTECTED] ICQ: 3617306 || "Did you ever get the feeling the world was a tuxedo, || and you were a pair of brown shoes?"