gsr has asked for the wisdom of the Perl Monks concerning the following question:
FIlE: Users.txt------------------------------ jblow::1337:21::::Joe Blow:/Network/Servers/schoolserv.domain/Volumes/ +UserFiles/Users/jblow::/bin/bash::<home_dir><url>afp\://same.ip.here/ +User%20Files</url><path>jblow</path></home_dir>:<?xml version="1.0" e +ncoding="UTF-8"?>\ <dict>\ <key>kAPOPRequired</key>\ <string>APOPNotRequired</string>\ <key>kAltMailStoreLoc</key>\ <string></string>\ <key>kAttributeVersion</key>\ <string>Apple Mail 1.0</string>\ <key>kAutoForwardValue</key>\ <string></string>\ <key>kIMAPLoginState</key>\ <string>IMAPAllowed</string>\ <key>kMailAccountLocation</key>\ <string>142.176.189.139</string>\ <key>kMailAccountState</key>\ <string>Enabled</string>\ <key>kPOP3LoginState</key>\ <string>POP3Allowed</string>\ <key>kUserDiskQuota</key>\ <string>0</string>\ </dict>\ ::<?xml version="1.0" encoding="UTF-8"?>\ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http\:/ +/www.apple.com/DTDs/PropertyList-1.0.dtd">\ <plist version="1.0">\ <dict>\ <key>simultaneous_login_enabled</key>\ <true/>\ </dict>\ </plist>\ --------------------EOF-Section-----------------------
which of course changes for each user.jblow::1337:21::::Joe Blow:/Network/Servers/schoolserv.domain/Volumes/ +UserFiles/Users/jblow::/bin/bash::<home_dir><url>afp\://same.ip.here/ +User%20Files</url><path>jblow</path></home_dir>:<?xml version="1.0" e +ncoding="UTF-8"?>\
#!/usr/bin/perl -w use strict; use warnings; @numarray= open (NUMLONG, "<$oldfile") or die "Error opening $oldfile +: $!"; @shortarray = open (SHORTLONG, "<$newfile") or die "Error opening $new +file : $!"; sub sessionclean { my $x = 0 foreach $key (@shortarray) if ($key =~ /\:{2}\d+\:{4}/) { } else { # ignore } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pattern Matching Question
by gaal (Parson) on Nov 30, 2004 at 05:19 UTC | |
|
Re: Pattern Matching Question
by brian_d_foy (Abbot) on Nov 30, 2004 at 06:17 UTC | |
|
Re: Pattern Matching Question
by NetWallah (Canon) on Nov 30, 2004 at 05:45 UTC | |
by gaal (Parson) on Nov 30, 2004 at 06:32 UTC | |
by NetWallah (Canon) on Nov 30, 2004 at 07:03 UTC | |
by gaal (Parson) on Nov 30, 2004 at 07:29 UTC | |
|
Re: Pattern Matching Question
by gsr (Novice) on Nov 30, 2004 at 23:42 UTC |