
SteffenBaier
Novice
Sep 28, 2009, 8:05 AM
Post #1 of 2
(484 views)
|
|
[HELP] Using a Perl Script in order to read Values and be able to replace them
|
Can't Post
|
|
Hi, I hade great help [url=http://perlguru.com/gforum.cgi?post=41021#41021]here reading a file and creating multiple files. The resulted Files are perfect now but I would like to be able now to create a HTMP Page that can read the File, display the content and be able to modify an entry Example file would be: LINE1 = 1006 LINE1_PROXY = 1 LINE1_CALLID = Sip Phone 1006 USER = Tilly PASSWORD = Friday FAVORITE = "7497"; "Eric" FAVORITE = 7497; "Eric2" FAVORITE = 3013; "SoundPoint 3013" FAVORITE = 3020; "Jane" FAVORITE = "93035551212"; "Richard's Cell" I now want the Perl script to open the file (working already) and print the lines on Favorites. The single Favorites Entry's (15 max) should only Display the actual Data and I would like to modify the data and write into the existing file (Overwrite) This is how far I am at present: #!/usr/bin/perl use strict ; use warnings ; my $extension = $ARGV[0]; open FILE, "sip_$ARGV[0].cfg" or die $!; while (<FILE>) { if (FAVORITE) { print "$1\n"; } } close(FILE); I found [url=http://perlguru.com/gforum.cgi?post=41484;sb=post_latest_reply;so=ASC;forum_view=forum_view_collapsed;;page=unread#unread]this Post but so far no luck in even displaying the Favorites via Print. I am able to fidle most stuff in some way or form into the Web Page THX Steff
(This post was edited by SteffenBaier on Sep 28, 2009, 8:39 AM)
|