Re: How To Integrate

2001-08-29 Thread Daniel
"Satish" <[EMAIL PROTECTED]> wrote: > I am a beginner to perl. > but i have woked in java. > now i would like to know how to intergrate these two Check out Inline::Java http://search.cpan.org/search?dist=Inline-Java -D -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-m

CPAN

2005-01-10 Thread Daniel
option and the perldocs, but cannot figure out how to reload my info. Please help!! Daniel -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: CPAN

2005-01-10 Thread Daniel
Thanks all worked like a charm! Daniel On Tue, 11 Jan 2005 00:42:02 -0500, Scott R. Godin <[EMAIL PROTECTED]> wrote: > Daniel wrote: > > I made a mistake when setting up CPAN, I chose Central America as my > > Continent, then the only option was to chose Costa Rica as my C

how to add .h files to .xs

2007-11-19 Thread Daniel
Hi, I am handling a project needing to call DLL by perl. I wrote the core code in C++ and I want to call these classes and functions in .xs. However, I don't know how to achieve this... First of all, I must include .h files in .xs, so I should add .h files in the same directory as .xs. I want to a

sleep under windows cmd

2004-02-22 Thread daniel
Hi helpers, I'm very new in perl programming(in programming at all acutally) and wondering about the following piece of code which I was running under W2K command-line: print "First"; sleep 2; print "Second"; I thought the script would print First then wait for 2 seconds and than print Second. Bu

\r -Option

2004-02-23 Thread daniel
Hi Guys, I'm running the following code under w2k command-line: $| = 1; #Autoflush print "Test\r"; sleep 2; print "OK"; and the output is OKst Eh, how can I delete the whole privious print output Thanks a lot... ... and all you helpful guys what you are doing is great and you have my ful

Getting Perl to interact with passwd

2001-06-11 Thread Daniel Ames
Hi all, This was brought up before, but the archives didn't really answer my question. I'm trying to get my script to reset a password for me via the passwd command. Keep in mind, I'm very new, so if this is dumb, try not to laugh: #!/usr/bin/perl open(handle, "| passwd joeuser"); print handl

RE: Getting Perl to interact with passwd

2001-06-11 Thread Daniel Ames
$ passwd --stdin Only root can do that But maybe you *are* root... Otherwise, you're going to need something like Expect.pm. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com - Awesome! That worked! Thanks Peter! ^_^ Daniel

RE: Getting Perl to interact with passwd

2001-06-12 Thread Daniel Ames
On Tue, 12 Jun 2001, Paul wrote: > --- Daniel Ames <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > This was brought up before, but the archives didn't really answer my > > question. > > > > I'm trying to get my script to reset a password fo

Re: Confused

2001-07-04 Thread Daniel Dwyer
> A friend of mine sent me a file to write > to help get me started on programming Perl. > So I did (in notepad): > > #!/usr/bin/perl -w > use strict; > while (<>) { > if ( /book/i or /bk/i) { > print; > } > Missing right curly or square bracket at findit.pl line 6, at end of line > syntax erro

Truth and SQL

2001-07-17 Thread Daniel Falkenberg
Hi list, Basically I want to be able to do an SQL query and if the query returns no results I want my script to say Ok your query rerurned 0 results print this message... "Sorry your seach returned no messages". What is my best way of going about this? Would it work similar to this... Do search

RE: Hyperlink to parse on SQL column entries.

2001-07-18 Thread Daniel Falkenberg
Hyperlink in my HTML is incorperated in my perl script. I > want this hyperlink to parse to another sub and then also parse on things > like $entries->{unique_id}... the unique_id of coarse in the new sub. I > can do this with the user selecting certain radio or check boxes and the

Is it Perl or my Web Server?

2001-07-23 Thread Daniel Falkenberg
ere is no reports of anything going wrong as I have checked all my logs. Does any one have any ideas as to why this is happeneing. I am using apache/squid on my linux redhad 7.1 box and using IE.5.5 as the client browser. Any ideas will help... Regards, Daniel Falkenberg -- To unsubscribe

OT - PostgreSQL

2001-07-24 Thread Daniel Falkenberg
ETED Any ideas on how to do this? Thanks in advance! Daniel Falkenberg -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

OT - PostgreSQL

2001-07-24 Thread Daniel Falkenberg
ETED Any ideas on how to do this? Thanks in advance! Daniel Falkenberg -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Running Perl scripts...

2001-07-24 Thread Daniel Falkenberg
List, I want to be able to check for errors on my Linux box before I run them in a browser. The problem is is tha when I do this all my HTML is dispalyed. I don't want to see this I want to be able to just check for any errors and display the errors only. Can I run them with out print what is

Re: No "make", "nmake", or "dmake" in build 628 of ActivePerl for Win32?

2001-07-24 Thread Daniel Dwyer
"Bob Abugov" <[EMAIL PROTECTED]> wrote: > Hi, I'm trying to build modules on a Win2K system using the Perl make >command. What do I need to do? When I try to use it after building a >Makefile, Perl can't seem to find here's what I get: > Use activestates PPM. Read more about it here. http://aspn

Re: Date verification

2001-07-25 Thread Daniel Grossman
0-2])-\d{4}\b/) { reject ... } else { celebrate ... } Note that my year validation is somewhat less robust than my month and day validation. :-) Daniel -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

DROP DOWN BOXEN

2001-07-25 Thread Daniel Falkenberg
information in a drop downbox correctly? Regards, Daniel Falkenberg sub add_job{ my $sth = $dbh ->prepare( qq{ SELECT username FROM db_users } ) || die $dbh->errstr; ; $sth->execute; my $entries; print<

Another pattern question

2001-07-26 Thread Daniel Mester
: foreach (@temp) { push(@temp2, (split(/\n/, $-))); } I am wondering - is there a way to do it in one turn? Must be, no? Daniel. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

UNIQUE ID problems...

2001-07-26 Thread Daniel Falkenberg
KES SENSE... Regards, Daniel Falkenberg -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Explaining myself correctly RE: SORTING BY DATE

2001-08-06 Thread Daniel Falkenberg
I can display the date as 7/8/2001 but I really need the zeros in there and displayed as year first. The code for this is as follows... my $lt= localtime; my $date_added = $lt->mday . '/' . ($lt->mon + 1) . '/' . ($lt->year + 1900); Any

PERL and HTML question...

2001-08-06 Thread Daniel Falkenberg
are of this? Regards, Daniel Falkenberg == VINTEK CONSULTING PTY LTD (ACN 088 825 209) Email: [EMAIL PROTECTED] WWW:http://www.vintek.net Tel:(08) 8523 5035 Fax:(08) 8523 2104 Snail: P.O. Box 312 Gawler SA 5

DBI Perl and rows...

2001-08-07 Thread Daniel Falkenberg
List, I have the following code here my $sth = $dbh ->prepare( qq{ SELECT * FROM table_name WHERE status <> 'DELETED' AND status <> 'COMPLETE' ORDER BY status } ) ||

Displaying 10 jobs per page worries...

2001-08-12 Thread Daniel Falkenberg
# points to another hyperlink(PERL SUB). This dispalys the next amount of jobs in the database, print< http://mysite.com/cgi-bin/script.cgi?action=z_jobs"; style="color: #99; font-size: 8pt; font-weight: bold">|NEXT xx J

test

2001-08-14 Thread Daniel Falkenberg
test == VINTEK CONSULTING PTY LTD (ACN 088 825 209) Email: [EMAIL PROTECTED] WWW:http://www.vintek.net Tel:(08) 8523 5035 Fax:(08) 8523 2104 Snail: P.O. Box 312 Gawler SA 5118 == -- To unsubscribe, e-mail: [EMAIL

Calculation the total of my column

2001-08-15 Thread Daniel Falkenberg
t? Any ideas would help imensly. kind regards, Daniel Falkenberg == VINTEK CONSULTING PTY LTD (ACN 088 825 209) Email: [EMAIL PROTECTED] WWW:http://www.vintek.net Tel:(08) 8523 5035 Fax:(08) 8523 2104 Snail: P.O. Box 312

(Answer to my own question) RE: Calculation the total of my column

2001-08-15 Thread Daniel Falkenberg
Dan, :) $sth = $dbh ->prepare( qq{ SELECT SUM(time_track_minutes) FROM table WHERE status = 'COMPLETE' } ) || die $dbh->errstr; ; $sth->execute

System calls?

2001-08-16 Thread Daniel Mester
Hello all, i need to get some system data from Windows 2000 as number of currently opened sockets, running threads, handles and processes - what is the best way to do it? Thanks. Daniel. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Graphing with PERL and HTML

2001-08-16 Thread Daniel Falkenberg
Dear list, Has any one here worked with Perl and HTML to draw graphs on a web page? Is there a module I can use to write these graphs. I am im very unfamilier ground here. Any ideas or input would be greatly appriciated. For everyone that wants to see some code :)... sub statistics{ my $sth

What does this error actually mean?

2001-08-16 Thread Daniel Falkenberg
/site_perl/5.6.0/GD/Graph/Map.pm line 366 Regards, Daniel Falkenberg == VINTEK CONSULTING PTY LTD (ACN 088 825 209) Email: [EMAIL PROTECTED] WWW:http://www.vintek.net Tel:(08) 8523 5035 Fax:(08) 8523 2104 Snail: P.O. Box 312 Gawler SA 5118

Perl Daemons

2001-08-31 Thread Daniel Falkenberg
I go about stopping this script... Regards, Daniel Falkenberg #!/usr/bin/perl -w #Testing daemons use POSIX qw(setsid); chdir '/' or die "Can't chdir to /: $!"; umask 0; open STDIN, '/dev/null' or die "Can't read /dev/null: $!";

Killing a deamon

2001-09-03 Thread Daniel Falkenberg
List, Is there a quiker way to restart a perl daemon in UNIX rather than having to do a kill -9 PID then start the service again using ./name_of_file.pl. Is there any easy way like restarting the httpd daemon service httpd restart? Kind Regards, Daniel Falkenberg -Original Message

RE: FileCache - use strict

2001-04-30 Thread Cron, Daniel
y still missing something. Thanks again! -Original Message- From: Johnathan Kupferer [mailto:[EMAIL PROTECTED]] Sent: Monday, April 30, 2001 4:34 PM To: Cron, Daniel Cc: '[EMAIL PROTECTED]'

how to ??

2001-05-01 Thread Daniel Choong
username and passwd, then detect the prompt and send the commands. i suppose there's a simple way to do that but i am lost. anyone knows how to do that? i tried using IPC::Open2 but i dunno how to use it properly. daniel __ Do You Yahoo!?

Running jobs in the background with backticks

2001-05-24 Thread Cron, Daniel
It seems that when I use backticks to kick off a job in the background, my perl script waits until the background job finishes. But it seems that the system command actually kicks things off and moves on. Here a perl script which demonstrates this behavior: #!/opt/local/bin/perl -w use strict;

Regex problem

2001-05-28 Thread Bornaz, Daniel
shrinks from left to right, like looking for the minimal match between "food" and "in", like in the following code: $stt="The food is under the bar in the barn in the river."; $stt=~/food(.*?)in/; print "$&"; Which prints correctly: food is under th

Tk Question

2001-05-29 Thread Bornaz, Daniel
Can anyone help me by telling me how can I scroll in program to the end of a Scrolled object after adding some text that goes out of the displayed area? Many thanks in advance, Daniel Bornaz GBS Specialist ~~ Compaq Computer Romania 77 Emanoil Porumbaru St

RE: Hashes and loops

2001-09-19 Thread Daniel Falkenberg
> List, > > I have the following while loop that goes and pings a whole heap of servers around our company. If one is broken or doesn't respond to the ping my code e-mails me the results of which server isn't responding. This all works well but I really need it to be able to keep pinging all the

Continuing a while loop

2001-09-20 Thread Daniel Falkenberg
List, I need the code below to execute the sub double_check($host) but I still want the while loop to continue exactly what it's doing. Is this possible with Perl|? while (1) { $p = Net::Ping->new("icmp", 4, 2); #Ping object. Uses icmp protocal foreach $host (sort keys (%host)) {

Running a Perl Script from a Perl script

2001-09-24 Thread Daniel Falkenberg
ALREADY RUNNING } else { print "Everything is fine \n"; } Regards, Daniel Falkenberg == VINTEK CONSULTING PTY LTD (ACN 088 825 209) Email: [EMAIL PROTECTED] WWW:http://www.vintek.net Tel:(08) 8523 5035 Fax:(08) 8523 2104 Snail: P.

Perl daemon and fork problems

2001-09-24 Thread Daniel Falkenberg
List, I have read and understood as much as I can about fork. But I have the following problem where I need to start up a second script in my first script. Problem is, if I have one already started as a deamon the second won't start as a deamon. Am I doing something terribly wrong here? This

RE: :FTP module

2001-09-25 Thread Daniel Falkenberg
Sofia, Try... http://search.cpan.org HIH, Daniel Falkenberg >From where can I download the Net::FTP module? Thanks in advance __ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. http://im.ya

Interesting TOP results

2001-09-26 Thread Daniel Falkenberg
make the while loop sleep for 20 seconds sleep 20; } Would this make any difference. Or has any one done any thing like this b4? Kind regards, Daniel Falkenberg == VINTEK CONSULTING PTY LTD (ACN 088 825 209) Email: [EMAIL PROTECTED] WWW:http

Unix time

2001-09-26 Thread Daniel Falkenberg
Hi all, Can some one please tell me how I would go about printing Unix time with Perl. I figured it would go something like this... $unixtime = localtime(); print $unixtime; Cheers, Daniel Falkenberg == VINTEK CONSULTING PTY LTD (ACN 088 825 209) Email: [EMAIL

Re: date/time

2001-10-01 Thread Daniel Gardner
to do is a simple test like: if (time > ($^T + (60*60*24))) { # we want to finish } but you could do something clever with POSIX::strftime as well... it depends on how exact you need to be... hth, daniel -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Modifying a text file with perl.

2001-10-01 Thread Daniel Falkenberg
List, I have comma seperated text file here with 3 entries per line... hello, world, 1 Is it possible with perl to change that value of 1 to 0? Regards, Daniel Falkenberg == VINTEK CONSULTING PTY LTD (ACN 088 825 209) Email: [EMAIL PROTECTED] WWW:http

Piping ifconfig to a text file

2001-10-03 Thread Daniel Falkenberg
List, Can some one help me with opening ifconfig and pipe it to a text file. Then I want to be able to view that file. How would I go about this? open IFCONFIG, "/sbin/ifconfig"; $file=; print $file; Kind regards, Daniel Falkenberg == VINTEK

Piping ifconfig to a text file

2001-10-03 Thread Daniel Falkenberg
> List, > > Can some one help me with opening ifconfig and pipe it to a text file. > Then I want to be able to view that file. > > How would I go about this? > > open IFCONFIG, "/sbin/ifconfig"; > $file=; > print $file; > >

Don't print...

2001-10-03 Thread Daniel Falkenberg
List, Can some one tell me why it is that the following code prints the results on the screen when I don't have the print command in there at all??? $shell = ifconfig("ppp0"); cp($shell, "/etc/ppp/ppp"); Regards, Dan == VINTEK CONSULTING PTY LTD (ACN 088 825 209) E

Copy file output to a text file

2001-10-03 Thread Daniel Falkenberg
> List, > > I have this problem that has been bothering me all day. All I want is > to be able to copy the out put of ifconfig to a text file > /etc/ppp/ppp.txt > > I have tried so many things but I can't get it to work. Once I have > done this I need to be able to extract the ADSL ip address

Help with regular expression.

2001-10-04 Thread Daniel Falkenberg
144.137.215.25 and store it in a variable. I am very new to regexes. So any help would be greatly appriciated. Daniel Falkenberg. == VINTEK CONSULTING PTY LTD (ACN 088 825 209) Email: [EMAIL PROTECTED] WWW:http://www.vintek.net Tel:(08) 8523 5035 Fax:(08) 8523

Config file problems

2001-10-04 Thread Daniel Falkenberg
List, I have a problem where I need a while loop to go through a config file change the remote IP address every time it finds it. There is blank line after each cfg part. I also need it to check to make sure that the data always starts with... Tunnel Name, IP tunnel Remote IP I suppose I woul

Cookie worries...

2001-10-21 Thread Daniel Falkenberg
this... test test 'path' 0 1157283456 29448914 789082896 29448899 Is there a problem with the third script? It doesn't seem to be populating $user? Any suggestions or comments would be creatly appriciated. Kind regards, Daniel Falkenberg FIRST SCRIPT.cgi - LOGIN PAGE #Norm

Net::Ping

2001-10-22 Thread Daniel Falkenberg
it sends and error message. Any ideas would be greatly appriciated. Kind regards, Daniel Falkenberg == VINTEK CONSULTING PTY LTD (ACN 088 825 209) Email: [EMAIL PROTECTED] WWW:http://www.vintek.net Tel:(08) 8523 5035 Fax:(08) 8523 2104 Snail: P.O. B

How weird is this...

2001-10-23 Thread Daniel Falkenberg
Hi all, ATM I am playing with cookies. I just came accross a really weird problem I am having... I would set the cookie in my browser and have in expire in 10 minutes. Then I logged out of my webpage and have the cookie deleted. This worked fine. I then logged back into my webpage and notice

System calls through a CGI script

2001-10-23 Thread Daniel Falkenberg
;t execute this system call? Does any one have any sugestions here? Kind Regards, Daniel Falkenberg == VINTEK CONSULTING PTY LTD (ACN 088 825 209) Email: [EMAIL PROTECTED] WWW:http://www.vintek.net Tel:(08) 8523 5035 Fax:(08) 8523 2104 Snail: P.O. Box 312

Regex frustration...

2001-10-24 Thread Daniel Falkenberg
Hi all, I am working on a regex that just won't do what it's told... Basically I have a file like the following... test1:x:26:testing1 test2:x:45:testing2 test3:x:45:testing3 test4:x:23:testing4 test5:x:45:testing5 Now I need to strip everything in there that is before the first ':' and o

Chainging values in a hash..

2001-10-25 Thread Daniel Falkenberg
Hey List, I am working on a problem where I have a hash of a hash that need updating and to be writen back into a text file. At the moment the hash looks like this... %hash = ( 'Crud1' => { 'test1' => 'crud10', 'test2' => 'crud11'

Stupid question...

2001-10-26 Thread Daniel Falkenberg
Hey List, This may sound like the stupidest question so far but, I was wondering the other day is it possible for perl programs (script.pl) to be compiled like a C/C++ programs are? I can't really find any documentation on this so I thought I figured I would ask some one here. Regards, D

Changing a Unix password.

2001-10-28 Thread Daniel Falkenberg
Hi all, I have a small CGI script here that is used to change users Unix passwords. Now before we go into security let me just tell you that the script is only accessable via a user name and password. The script is also only accessable on an internal network and the every character in each para

Updating /etc/passwd

2001-10-29 Thread Daniel Falkenberg
Hi all, I really need some help on updateing the Unix /etc/passwd file. Basically I have a script that reads it like the following... $file = '/etc/passwd'; my $hash_ref; my %hash_ref; open FILE, "$file" or die "$file: $!\n"; while ( ) { my @list = split ':'; if($list[3] == 45) {

sub read_config is killing my daemon

2001-10-29 Thread Daniel Falkenberg
Hey All, I have a perl script here (below) that becomes a daemon when ever I run it. But when ever it goes to read the script it it dies on me? Can any one tell me what is going on here? If I remark (#) the read_config(); in the while loop the daemon doesn't break. Does any one here have any

Changing users postfix password

2001-10-30 Thread Daniel Falkenberg
Hey all, I am working on a CGI script where I need it to change a users postfix password. At the moment my script runs as apache and I really need to issue this command... system("echo $password | /usr/bin/sudo passwd --stdin $username"); This command works from a Unix prompt but doesn't work

Re: create hash slice from hash

2001-10-31 Thread Daniel Gardner
t;) LN> I want the slice to include only the keys test1 and test3. How can I LN> accomplish this? you could use map: my %new_hash = map { $_ => $hash{$_} } qw(test1 test2); map is a really useful function... hth, daniel -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Regex syntax

2001-10-31 Thread Daniel Gardner
lue eq 'foo'; FN> 2. If I've made the assignment $tempstring = substr($_ ,0,20) how do I FN> remove trailing spaces from $tempstring? so do $tempstring =~ s/\s+//; hth, daniel -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: array of hashes

2001-10-31 Thread Daniel Gardner
machines => ["dec1", "dec2"], }, ); but it really depends on what it is you're doing with the data. you want to design your data structure around the processing, rather than designing a data structure that looks nice, but makes the code hard. perhaps if you let us know what you want to do with it we might be able to give some suggestions. hth, daniel -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Encryption

2001-10-31 Thread Daniel Falkenberg
Hey all, Just wondering what the best way to find out what encryption I am running on my Unix maxchine. Basically I have a problem where I need to add a user from a Perl script something similar to the following... use Crypt::PasswdMD5; my $salt; $password = "password"; $cryptedpassword = unix_

Silly problem

2001-11-02 Thread Daniel Falkenberg
G'day All, I have this very very simple problem that I can't figure out. Basically I have a 1 line text file with an IP address in it like so... 192.168.0.2 Now all I want to do is open this file up and extract the IP address from it. Now the good thing is I can do this OK but whenever I extr

Can any one see any thing wrong with this?

2001-11-08 Thread Daniel Falkenberg
Hey all, Now basically whenever I try and connect it seems to login ok but when ever try and issue the command I get the following error Permission denied at ./test.pl line 12 $remote_host = "xxx.xxx.xxx.xxx"; $user= "user"; $pass= "password"; my $ssh = Net::SSH::Perl-

[OT] NT mailing list

2001-11-08 Thread Daniel Falkenberg
Hi all, I am really sorry to bother all of you with this one. But I am about to start working on a new project using Active Perl but before I begin I need to know some information on Win2k/NT4. My question is does any one know of any windows Mailing lists? Now I have searched the net for these

/etc/passwd problem

2001-11-08 Thread Daniel Falkenberg
Hey all, I have a script here that I want to be able to add a * next to all the users in that I want with the UID of 45 in /etc/passwd. Example... test:x:530:45:Test Name:/home/test:/bin/false test2:x:531:45:Test Name2:/home/test2:/bin/false I want... *test:x:530:45:Test Name:/home/test:/bin/

Re: Off-Topic (200%) - Where are you from?

2001-11-10 Thread Daniel Gardner
Manchester, UK Friday, November 09, 2001, 4:07:57 PM, you wrote: JE> Leeds, UK JE> -Original Message- JE> From: Mike Gargiullo [mailto:[EMAIL PROTECTED]] JE> Sent: 09 November 2001 16:13 JE> To: [EMAIL PROTECTED] JE> Subject: RE: Off-Topic (200%) - Where are you from? JE> Princeton J

What is happening here...?

2001-11-12 Thread Daniel Falkenberg
Hi all, Below is a chunk of code that I don't really know what's going on? Could some one give me a few ideas? perl -F: -i -ape'$F[3] == 45 && s/^/*/' /etc/passwd Regards, Dan == VINTEK CONSULTING PTY LTD (ACN 088 825 209) Email: [EMAIL PROTECTED] WWW:http://w

Can I issue this from an actual script?

2001-11-12 Thread Daniel Falkenberg
Hi all, Can this code below be issued from an actual perl script? perl -F: -i -ape'$F[3] == 45 && $_ =~ /^test/ && s/^/*/' /etc/passwd regards, Dan == VINTEK CONSULTING PTY LTD (ACN 088 825 209) Email: [EMAIL PROTECTED] WWW:http://www.vintek.net Tel:(08) 8

RE: What is happening here...?

2001-11-12 Thread Daniel Falkenberg
Curtis, Cheers for that that makes alot more sense now :). Yes your are correct about the /etc/passwd file. It's all well and good to be able to issue that command from a command line, but what if I wanted to issue the exact same code but from a script? Regards, Dan Dan, Here's a list of th

expanding a pattern

2001-11-13 Thread Daniel Kidger
I have a pattern like $hosts = "fred[1,3-7,9-22]" Is there a simple way to generate an expanded list like: fred1 fred3 fred4 fred5 ... etc. ? Daniel. -- Dr. Dan Kidger, Quadrics Ltd. [EMAIL PROTECTED] One Br

accepting --stdin from sudo command

2001-11-13 Thread Daniel Falkenberg
Hey all, I really want to be able to issue this command from a perl script but unfortunatly I don't want to have to use the expect programming language to input the password. I have the following command below... Does this look OK? echo password | sudo cp -f /etc/passwd /home/me --stdin Cheers

Complex question about GD::Graph

2001-11-13 Thread Daniel Falkenberg
Hey all, I have some user details that I want placed in this graph. Probem is my Perl skills arn't all that good. Could some one give me some ideas with the following? I have a hash here (%users) the Key here is their static IP address. The value is just some data. Now the problem I am having

IP accounting

2001-11-15 Thread Daniel Falkenberg
Hey all, I am just about to start a new project. Before I start I wouldn't mind some input if any one has any == VINTEK CONSULTING PTY LTD (ACN 088 825 209) Email: [EMAIL PROTECTED] WWW:http://www.vintek.net Tel:(08) 8523 5035 Fax:(08) 8523 2104 Snail:

IP accounting

2001-11-15 Thread Daniel Falkenberg
Hello List, Just about to begin a new project where I am going to start to create some IP accounting software using Perl or coarse. Before I being I woudn't mind getting some information from any one that has done any of this before. Firstly the network I will be monitoring will consist of user

Adding a line to the end of /etc/shadow

2001-11-15 Thread Daniel Falkenberg
Hey all, Just a quick question I want to be able to a line from /etc/passwd and append it to the end of /etc/shadow. So far I have the following. #!/usr/bin/perl -w my $passwdFILE = '/etc/passed'; #System password file my #shadowFILE = '/etc/shadow'; my $user = 'test'; #User details to be move

Appening a line to /etc/passwd

2001-11-15 Thread Daniel Falkenberg
Hey List, Just a quick question. I have the following code below... sub ADD_SHADOW { my $passwdFILE = '/etc/passwd'; my $shadow = '/etc/shadow'; open FILE, "$passwdFILE" or die "Cannot open $passwdFILE in READ ONLY mode:$!"; open SHADOW, ">>$shadow" or die "Cannot open $shado

Re: pattern matching

2001-11-18 Thread Daniel Gardner
the file. "print" works in array context, and the angle brackets <> will return all the lines in array context. if we force it to scalar context it will only return the next line. hth, daniel -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: include a file

2001-11-19 Thread Daniel Gardner
p include because it won't evaluate any code that's in the other file, but if all you want to do is cat a file containing html then this should be okay for you. -- Best regards, Daniel -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: [OT] Who's online, which is the best method?

2001-11-19 Thread Daniel Gardner
o see who is "there", do a select from the table where last_access > 10 minutes ago if you have only a few users then this will be okay, but if you have lots of users then a cron job to delete records where the user hasn't accessed for more than 10 minutes running once a

Re: Use of packages

2001-11-19 Thread Daniel Gardner
sub sub1 { perl code here } sub sub2 { perl code here } 1; and then in your script: use packagename qw(sub1 sub2); sub1(); sub2(); [1] http://www.perldoc.com/perl5.6.1/lib/Exporter.html -- Best regards, Daniel -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

Unix passwd rules

2001-11-19 Thread Daniel Falkenberg
Hi all, I understand this is a little off topic, but it essetially this question has alot to do with Perl. My question is what are the curent rules for a Unix passwd? i.e How many characters? Also has any one had anything to do with the module Unix::PasswdFile. I have the following code that in

Daemons

2001-11-19 Thread Daniel Falkenberg
Hey all, I am working with daemons at the moment. What I want to know is... 1 - Is it possbile for my script to report a message everytime my program dies. My program currently runs as a daemon. Sometimes I get up in the morning and the program (Perl deamon) isn't running any more. Thx, Dan

Re[2]: Little pb with sort ...

2001-11-20 Thread Daniel Gardner
o a string comparison... as strings "12" is less that "5", but as numbers 5 is obviously less than 12. -- Best regards, Daniel -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re[2]: Sorting a list of links by the linked text

2001-11-20 Thread Daniel Gardner
printf "%-20s - %-s\n", $line->[1], $line->[0]; printf is like doing a print and an sprintf [4]. that funny string with the %'s in it is a template which says that we'd like the data formatted please and how we'd like it formatted. in this case, we'd like the f

Re: How to delete hash element

2001-11-20 Thread Daniel Gardner
he offset of the element" -- Best regards, Danielmailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re[2]: How to delete hash element

2001-11-20 Thread Daniel Gardner
perldoc -f delete AMIA> - Original Message - AMIA> From: Daniel Gardner AMIA> To: Ahmed Moustafa Ibrahim Ahmed AMIA> Cc: [EMAIL PROTECTED] AMIA> Sent: Tuesday, November 20, 2001 12:50 PM AMIA> Subject: Re: How to delete hash element AMIA> Tuesday

Re[2]: Getting past "Use of uninitialized value..."

2001-11-21 Thread Daniel Gardner
way use the variable more than once without affecting TC> the value, I'd like to hear it. i'm interested - why do you need the variables if you're only using them once... and what does it matter if you change the value if you're never going to look at it

Re: checking if a file exists

2001-11-22 Thread Daniel Gardner
o check if the file already GFFC> exists. you can use the -e operator... $file = '/etc/passwd'; if (-e $file) { # the passwd file exists } perldoc -f -X http://www.perldoc.com/perl5.6.1/pod/func/X.html -- Best regards, Danielmailto:[EMAIL PROTECT

Re[2]: @_

2001-11-25 Thread Daniel Gardner
he variables into our subroutine. we could say: my @foo = (1,2,3); my ($value1, $value2, $value3) = @foo; and now $value1 == 1, $value2 == 2 and $value3 == 3. so it's the same when we use @_ at the start of a function. my ($a, $b) = @_; does that make it any clearer? -- Best regards, Danielmailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Passwd::Linux

2001-11-25 Thread Daniel Falkenberg
Hi all, Has any one here had any experience with the Passwd::Linux Cpan module before? If you have I would really like to hear from you to get some ideas. Regards, Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Simple question

2001-11-25 Thread Daniel Falkenberg
Hey all, Just a simple question could some one give me a clue as to what the folling regex will match... $user = "daniel"; if ( $test =~ /^$user/ ) { print "Hello world!\n"; } Will it match only daniel or will it match dan || danni and so on? Cheers, Dan -- To

RE: Simple question

2001-11-25 Thread Daniel Falkenberg
stafa Ibrahim Ahmed wrote: > It will match only "daniel". It's the same as: if ($test eq $user). > Regards, > Ahmed > > Daniel Falkenberg wrote: > >> Hey all, >> >> Just a simple question could some one give me a clue as to what the >> follin

Any quicker way of writing the following...?

2001-11-26 Thread Daniel Falkenberg
Hey all, Once again I feel as if the following code is far too long and can easily be shortened. Could some one give me some ideas on doing this? foreach my $U (sort keys %PASS) { $PASS{$U}{'fname'} = ""; $PASS{$U}{'lname'} = ""; $PASS{$U}{'user'} = ""; $PASS{$U}{'password'

  1   2   3   4   5   6   7   >