Thread Daten in Hash schreiben (13 answers)
Opened by cohama at 2014-10-28 11:34

rosti
 2014-10-28 14:15
#178003 #178003
User since
2011-03-19
3193 articles
BenutzerIn
[Homepage]
user image
Also kurz und knapp, der String sieht aus wie ein QUERY_STRING. Ergo nehmen wir mal CGI.pm um das Teil in eine gefällige Datenstruktur zu verwandeln:

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
use strict;
use warnings;
use Data::Dumper;
use CGI;

my $str = q(SCRL_MODE_OUT=0&DATEALLOCATED=2011-11-16&EMAIL=XXX&LOCALIZATIONTYPE=30&LISTEN=0&RPCID=320339&H_OUTPROFILID=2&CTID=6&FWD_UNC_NAT=3&H_ABOPROFILID=3&CAWONESHOT=1&MFWD_TIMER1=5&FWD_NRPTIMEOUT=5&RPCALLINGNAT=3&RANGEID=10&FWD_BUSY_NAT=255&MUSICONWAIT=0&FWD_UNC_ON=0&ACR_ON=0&NAT_CARRIER_ON=0&COMPID=3&EXPIRY_TIME_DST=0&NRPORIGNAT=255&RINGBACKTONE=0&SITEID=-1&LOCATION_NUM=XXX&LOCATION_NAT=255&MFWD_MODE=0&FWD_NRP_NUM=XXX&SWITCHID=1&MFWD_NUM2=XXX&RPCALLINGDATE=2014-10-15&FWD_NRP_ON=0&ACCESSPARID=21&NRPCALLEDNAT=3&ICBPROFILID=-1&H_FWDPROFILID=2&MFWD_NUM1=XXX&NAME=lab_number&FWD_BUSY_ON=0&BUILDINGNUMBER=11&H_SUSPEND=0&LATF_TIMER=0&RPORIGNAT=0&NRPRGCALLEDNUM=XXX&AAB_ON=0&H_INPROFILID=2&H_SPECNUMZONEID=9999&RPCALLINGTIME=10.41.48&NETWORK_NUM=XXX&CIVIL=0&NRPRGCALLEDNAT=255&MFWD_TIMER2=5&NETWORK_NAME=XXX&NRPCALLINGNUM=15141858665&IN_APPLICAB=0&BUILDINGCHAR=&MFWD_TIMER3=5&EXPIRY_DATE=2014-10-28&NRPCID=0&SCRL_MODE_IN=0&H_CFBACKUP_ON=0&MOBILENUM=XXX&DOMAIN=sip.berlin.registrar.de&COLR_ON=0&ICAC=0&NRPCALLEDNUM=11833&MWI_IND=0&FWD_BUSY_NUM=XXX&IPAD_ON=0&LATF_NAT=255&LATF_NUM=XXX&MFWD_NAT2=255&BIS_NAT=3&NRPORIGNUM=XXX&LISTEN_TRUNK=XXX&RPCALLINGNUM=3066765110&RPCLIR=0&LOG=493092038888&SIP_PREF_ON=0&MFWD_NAT4=255&MUSICONHOLD=0&CADRINGING=0&H_CFBACKUP_NUM=XXX&PATH=XXX&ADMINLEVEL=0&LISTEN_NUM=XXX&LISTEN_NAT=255&LOCK_ON=0&NRPCALLINGNAT=3&ACCESSNAME=SIP&MFWD_NUM3=XXX&FWD_UNC_NUM=15114534613&NRPCALLING_IND=149&MOBILENAT=255&SERVICES_LOCK=0&MFWD_TIMER4=5&NRPCALLINGTIME=11.40.25&GIVENNAME=XXX&LOCK_CODE=0000&NRPCLIR=0&SCRL_CODE_OUT=0000&BIS_NUM=1719500359&STREETNAME=Checkpoint&FWD_NRP_NAT=255&CONNECTINBAND=0&DATACALL_ON=1&NRPCALLINGDATE=2014-10-17&EXTENSIONNUM=3092038888&MFWD_NAT1=255&GROUPID=2&EXTENSIONNAT=3&ADMIN_STATE=0&SWITCHID_BCKUP=-1&NETWORK_NAT=255&MFWD_NAT3=255&CAW_ON=0&VENDORID=D167&POSTALCODE=10409&ACCESSTYPE=3&CLIR_ON=0&USERNAME=schneiderLogin&MFWD_NUM4=XXX&H_ACCOUNTID=1&H_CFBACKUP_NAT=255&H_LANGUAGE=DE&FPAD_ON=0&OCBPROFILID=-1&INTERCOM_AUTH=0&RPCALLINGDUR=4&EXPIRY_TIME=11.29.29&INT_CARRIER_ON=0&RPORIGNUM=XXX&PWD=GBWoZcT9o1bIwKotyxz083FA&NCAC=0&DND_ON=0);

my $p = CGI->new($str);

print Dumper $p->param('PWD');

# das gibt aus:
$VAR1 = 'GBWoZcT9o1bIwKotyxz083FA';

View full thread Daten in Hash schreiben