CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
[HELP] Using a Perl Script in order to read Values and be able to replace them

 



SteffenBaier
Novice

Sep 28, 2009, 8:05 AM

Post #1 of 2 (698 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:


Quote
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:


Code
 #!/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)


FishMonger
Veteran / Moderator

Sep 28, 2009, 8:21 AM

Post #2 of 2 (693 views)
Re: [SteffenBaier] [HELP] Using a Perl Script in order to read Values and be able to replace them [In reply to] Can't Post


Code
/^FAVORITE\s*=\s*(.+)$/


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives